mirror of
https://github.com/memen45/SubMusic.git
synced 2026-02-18 00:57:39 +01:00
added workaround for Plex' missing metadata
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
Version [] -
|
||||
|
||||
Version [0.2.6] - 19-10-2022
|
||||
- added workaround for Plex' missing metadata
|
||||
|
||||
Version [0.2.5] - 16-10-2022
|
||||
- fixed Plex sync error with larger playlists
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- This is a generated file. It is highly recommended that you DO NOT edit this file. -->
|
||||
<iq:manifest xmlns:iq="http://www.garmin.com/xml/connectiq" version="3">
|
||||
<iq:application entry="SubMusicApp" id="62436b93f69e4823a8b41854b6684b4a" launcherIcon="@Drawables.LauncherIcon" name="@Strings.AppName" type="audio-content-provider-app" version="0.2.5">
|
||||
<iq:application entry="SubMusicApp" id="62436b93f69e4823a8b41854b6684b4a" launcherIcon="@Drawables.LauncherIcon" name="@Strings.AppName" type="audio-content-provider-app" version="0.2.6">
|
||||
<iq:products>
|
||||
<iq:product id="d2air"/>
|
||||
<iq:product id="d2airx10"/>
|
||||
|
||||
@@ -197,8 +197,8 @@ class AmpacheProvider {
|
||||
}
|
||||
d_response.add(new Song({
|
||||
"id" => song["id"],
|
||||
"title" => song["title"],
|
||||
"artist" => song["artist"]["name"],
|
||||
// "title" => song["title"],
|
||||
// "artist" => song["artist"]["name"],
|
||||
"time" => time.toNumber(),
|
||||
"mime" => song["mime"],
|
||||
"art_id" => song["id"],
|
||||
|
||||
@@ -348,8 +348,8 @@ class SubsonicProvider {
|
||||
}
|
||||
songs.add(new Song({
|
||||
"id" => song["id"],
|
||||
"title" => song["title"],
|
||||
"artist" => song["artist"],
|
||||
// "title" => song["title"],
|
||||
// "artist" => song["artist"],
|
||||
"time" => time.toNumber(),
|
||||
"mime" => song["contentType"],
|
||||
"art_id" => song["coverArt"],
|
||||
|
||||
@@ -33,6 +33,14 @@ class Audio extends Storable {
|
||||
return d_audio.artwork();
|
||||
}
|
||||
|
||||
function title() {
|
||||
return d_audio.title();
|
||||
}
|
||||
|
||||
function artist() {
|
||||
return d_audio.artist();
|
||||
}
|
||||
|
||||
function time() {
|
||||
return d_audio.time();
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ class Episode extends Storable {
|
||||
// required external episode properties
|
||||
"id" => null, // id of the episode
|
||||
"title" => "", // title of the episode
|
||||
"artist" => "", //
|
||||
"time" => 0, // duration of the episode
|
||||
"mime" => "", // string e.g. "audio/mpeg"
|
||||
"art_id" => null, // null if no art_id available
|
||||
@@ -30,6 +31,10 @@ class Episode extends Storable {
|
||||
function title() {
|
||||
return d_storage["title"];
|
||||
}
|
||||
|
||||
function artist() {
|
||||
return d_storage["artist"];
|
||||
}
|
||||
|
||||
function time() {
|
||||
return d_storage["time"];
|
||||
|
||||
@@ -233,8 +233,8 @@ class ISong extends Song {
|
||||
// update the variables
|
||||
var changed = updateAny("time", song.time());
|
||||
changed |= updateAny("mime", song.mime());
|
||||
// changed |= updateAny("title", song.title()); // not used, so no storage needed
|
||||
// changed |= updateAny("artist", song.artist()); // not used, so no storage needed
|
||||
changed |= updateAny("title", song.title()); // not used, so no storage needed
|
||||
changed |= updateAny("artist", song.artist()); // not used, so no storage needed
|
||||
changed |= setArt_id(song.art_id());
|
||||
if (changed) {
|
||||
save();
|
||||
|
||||
@@ -116,6 +116,16 @@ class SubMusicContentIterator extends Media.ContentIterator {
|
||||
var content = Media.getCachedContentObj(contentRef);
|
||||
var metadata = content.getMetadata();
|
||||
|
||||
// add stored metadata if not given in file (Plex does not provide metadata in file)
|
||||
var has_title = (metadata.title != null) && (metadata.title instanceof Lang.String) && (!metadata.title.equals(""));
|
||||
var has_artist = (metadata.artist != null) && (metadata.artist instanceof Lang.String) && (!metadata.artist.equals(""));
|
||||
if (!has_title) {
|
||||
metadata.title = audio.title();
|
||||
}
|
||||
if (!has_artist) {
|
||||
metadata.artist = audio.artist();
|
||||
}
|
||||
|
||||
// default playback is 0, unless in podcast mode, some position is stored before and position is not within five seconds of the end
|
||||
var playbackStartPos = 0;
|
||||
if (d_playable.podcast_mode()
|
||||
|
||||
@@ -2,8 +2,8 @@ class SubMusicVersion {
|
||||
|
||||
private var d_major = 0;
|
||||
private var d_minor = 2;
|
||||
private var d_patch = 5;
|
||||
private var d_name = "argalus";
|
||||
private var d_patch = 6;
|
||||
private var d_name = "kynortas";
|
||||
|
||||
function initialize(storage) {
|
||||
if (storage == null) {
|
||||
|
||||
@@ -43,10 +43,22 @@ module SubMusic {
|
||||
// load the menuitem
|
||||
var id = d_ids[idx];
|
||||
var isong = new ISong(id);
|
||||
var meta = isong.metadata();
|
||||
var metadata = isong.metadata();
|
||||
|
||||
// add stored metadata if not given in file (Plex does not provide metadata in file)
|
||||
var has_title = (metadata.title != null) && (metadata.title instanceof Lang.String) && (!metadata.title.equals(""));
|
||||
var has_artist = (metadata.artist != null) && (metadata.artist instanceof Lang.String) && (!metadata.artist.equals(""));
|
||||
if (!has_title) {
|
||||
metadata.title = isong.title();
|
||||
}
|
||||
if (!has_artist) {
|
||||
metadata.artist = isong.artist();
|
||||
}
|
||||
|
||||
// add the item
|
||||
items.add({
|
||||
LABEL => meta.title,
|
||||
SUBLABEL => meta.artist,
|
||||
LABEL => metadata.title,
|
||||
SUBLABEL => metadata.artist,
|
||||
METHOD => id,
|
||||
// OPTION => isong.artwork(),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user