diff --git a/app/cyp.js b/app/cyp.js index 5bd02d1..fb3c390 100644 --- a/app/cyp.js +++ b/app/cyp.js @@ -896,9 +896,16 @@ function time(sec) { function subtitle(data, options = {duration:true}) { let tokens = []; - data["Artist"] && tokens.push(data["Artist"]); + + if (data["Artist"]) { + tokens.push(data["Artist"]); + } else if (data["AlbumArtist"]) { + tokens.push(data["AlbumArtist"]); + } + data["Album"] && tokens.push(data["Album"]); options.duration && data["duration"] && tokens.push(time(Number(data["duration"]))); + return tokens.join(SEPARATOR); } @@ -983,8 +990,8 @@ class Player extends Component { this._dispatchSongChange(data); } - let artistNew = data["AlbumArtist"] || data["Artist"]; - let artistOld = this._current.song["AlbumArtist"] || this._current.song["Artist"]; + let artistNew = data["Artist"] || data["AlbumArtist"]; + let artistOld = this._current.song["Artist"] || this._current.song["AlbumArtist"]; let albumNew = data["Album"]; let albumOld = this._current.song["Album"]; diff --git a/app/index.html b/app/index.html index 31e80e8..ec16b4d 100644 --- a/app/index.html +++ b/app/index.html @@ -98,6 +98,6 @@ - + diff --git a/app/js/elements/library.js b/app/js/elements/library.js index e654605..b83a4ba 100644 --- a/app/js/elements/library.js +++ b/app/js/elements/library.js @@ -166,7 +166,7 @@ class Library extends Component { let results = new Map(); songs.forEach(song => { let filter = {}, value; - const artist = song["AlbumArtist"] || song["Artist"] + const artist = song["AlbumArtist"] || song["Artist"]; if (tag == "Album") { value = song[tag]; diff --git a/app/js/elements/player.js b/app/js/elements/player.js index f40b555..f07bd82 100644 --- a/app/js/elements/player.js +++ b/app/js/elements/player.js @@ -81,8 +81,8 @@ class Player extends Component { this._dispatchSongChange(data); } - let artistNew = data["AlbumArtist"] || data["Artist"]; - let artistOld = this._current.song["AlbumArtist"] || this._current.song["Artist"]; + let artistNew = data["Artist"] || data["AlbumArtist"]; + let artistOld = this._current.song["Artist"] || this._current.song["AlbumArtist"]; let albumNew = data["Album"]; let albumOld = this._current.song["Album"]; diff --git a/app/js/format.js b/app/js/format.js index a7076ac..0ac8548 100644 --- a/app/js/format.js +++ b/app/js/format.js @@ -9,9 +9,16 @@ export function time(sec) { export function subtitle(data, options = {duration:true}) { let tokens = []; - data["Artist"] && tokens.push(data["Artist"]); + + if (data["Artist"]) { + tokens.push(data["Artist"]); + } else if (data["AlbumArtist"]) { + tokens.push(data["AlbumArtist"]); + } + data["Album"] && tokens.push(data["Album"]); options.duration && data["duration"] && tokens.push(time(Number(data["duration"]))); + return tokens.join(SEPARATOR); }