mirror of
https://github.com/koel/koel.git
synced 2026-04-25 08:46:00 +03:00
[GH-ISSUE #403] Discussion: Compilation Albums #290
Labels
No labels
Authentication
Dependencies
Documentation
Feature Request
Flac
Help Wanted
Installation/Setup
Integration
Mobile
PR Welcome
Pending Release
Performance
Playlist
S3
Search
Sync
[Pri] Low
[Pri] Normal
[Status] Keep Open
[Status] Needs Author Reply
[Status] Needs Review
[Status] Stale
[Status] Will Implement
[Type] Blessed
[Type] Bug
[Type] Duplicate
[Type] Enhancement
[Type] Help Request
[Type] Question
[Type] Task
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/koel-koel#290
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @BernardGoldberger on GitHub (Aug 11, 2016).
Original GitHub issue: https://github.com/koel/koel/issues/403
I might be in over my head, but I think the solution for compilation has been somewhat over complicated.
[please correct me if I'm wrong]
Original implementation
We record artist info at the album level, which presented an issue when it came to compilation albums as it would separate the song into multiple albums, this was caused by albums being depended on Artists
artist->album->songCurrent solution
We always ignore song artist and simply store that at the album level We use the
albumArtisttag to determine if a song is part of compilation album.If it is part of a compilation we record the artist on the song level as
contributing_artistand on the album level we set it tovarious artists.We present the album in the following manner.
In the Artist view
contributing_artist->album, Issue is, songs are still being separated.In the Album view
variousArtists->album.The issue is that the album is still not being presented in the artist section, and even if we were to implement in the Artist view
variousArtist->albumit still would not be listed under the albumArtist.Suggested solution
contributing_artist, every song has one.albumArtiston the song level, and if aalbumArtistis not present we set it to thecontributing_artist.In the views we will present them as follows.
In the Artist view
albumArtist->albums, a possible issue might be if a album has songs with different albumArtist [have yet to see one myself], in that case we still have thecompilationcolumn and ifis_compilationwe then dovariousArtits->album.In the Album view
albumArtist->albumOf course on the song item we display the
contributing_artist.In conclusion, I think there are ways of solving compilation albums while removing much of the complexity that there seems to be around it.
@phanan commented on GitHub (Aug 11, 2016):
Thanks for the proposal. You're absolutely right, the "compilation albums" feature is buggy and over complicated, admittedly due to my short sight at the beginning of the project. Solving the problem from scratch (like what you proposed above, even though I'd need some time to wrap my head around it), though, is not the biggest issue; keeping the migration path simple and straightforward is. The more changes we introduce into the data structure, the less smooth migration becomes.
With that said, the proposal looks promising. I'll spend the next couple of days to think about it when I have time. Thanks again for the contribution 👍
@X-Ryl669 commented on GitHub (Aug 11, 2016):
Let's take an example here, with a virtual album
Classical musicwith 2 songs (Vivaldi - Summer,Mozart - Requiem). The usual tags you'll find in the files are:albumwhich will be set toClassical Musicfor both andartist(one will beVivaldiand the otherMozart).Currently, it shows twice in the album list because there are 2 different artists (each containing a single song)
In your proposal, what would be the
albumArtist?In the artist view, should it be listed twice under
MozartandVivaldior only once underVarious Artists?@BernardGoldberger commented on GitHub (Aug 11, 2016):
@> In your proposal, what would be the
albumArtist?Well, that depends on what the
albumArtisttag is, see example below where there are different artists for each song but the samealbumArtistHowever, in your case a virtual album I wouldnt expect there to be a
albumArtistso it will be presented undervariousArtists.You do bring up a valid point that I forgot to mention,
As I said this would be listed under
variousArtists, but, what if someone wants to play all the music by Mozart? why should the particular song not be part of the play list?So, personally I'm open to the idea that any given song should always be displayed under the
contributing_artisteven if its already listed under thealbumArtist.Explanation
As I wrote above in the artist view we would present
albumArtist->albumwhich mean that it will be listed only undervariousArtits.What we could do in addition to that is, that once we click on an artist, technically speaking its an
artistID, so in addition to "grouping" all thealbumsthat theartistIdis thealbumArtistfor, we also list any songs thatArtistID is thecontributing_artist`.With that, in your case, it will be listed under
VariousArtists, but if you click on Mozart it will be listed there as well under the AlbumClassical music.@X-Ryl669 commented on GitHub (Aug 12, 2016):
I'm not sure I've my songs tagged with
albumArtistorcontributingArtistbut simplyartistandalbum, and I think I'm unlikely to retag all of them like this. Thus, I don't understand how the scheme you are proposing would work.@BernardGoldberger commented on GitHub (Aug 14, 2016):
artistandcontributingArtistare the same, you can use a tag editor software to see if you have any additional tags on the song.You can use something like MP3TAG.
@X-Ryl669 commented on GitHub (Aug 14, 2016):
Ok, I didn't know about it.
But for album ? If I have an album for an artist,
albumArtistwill not be set (albumwill). I don't want all my albums been located under "Various Artist".@BernardGoldberger commented on GitHub (Aug 14, 2016):
@phanan commented on GitHub (Aug 15, 2016):
I don't think we need to set
albumArtistat the song level, as we can always refer to$song->album->artist_id. In other words, if I get it right, the new solution has one critical difference:contributing_artist_idis always present, and refers to the real performing artist. With this, we can always rely on this column for artist information, andalbum_idfor album information.Migration should also be straightforward if this is the case. @bdgold can you confirm my understanding?
@BernardGoldberger commented on GitHub (Aug 15, 2016):
@phanan consider the following 2 scenarios.
contributing_artistbut noalbumArtistis present.albumArtist's between the songs.My thought was that if we record
albumArtiston the song level we would be able to detect them and place the Album undervariousArtist's in the view.@BernardGoldberger commented on GitHub (Aug 15, 2016):
@phanan I see that you included
Genre, could https://github.com/phanan/koel/pull/318 be considered again? especiallyYear.@phanan commented on GitHub (Aug 15, 2016):
@bdgold There shouldn't be the case of one album with different album artists. That just doesn't make sense, and Koel's parser will create multiple albums instead.
@BernardGoldberger commented on GitHub (Aug 15, 2016):
I agree that even if it would, its a failure on the users side, I was just thinking of the "what if".
What about the other scenario?
@phanan commented on GitHub (Aug 15, 2016):
For the other scenario, we have a default "Various Artists" as the album artist, no?
@BernardGoldberger commented on GitHub (Aug 15, 2016):
Ah, Correct.
@X-Ryl669 commented on GitHub (Aug 18, 2016):
If a song as the same
albumtag as some other song but a differentcontributing_artist, then can the album be marked as a compilation automatically ?Said differently, is it correct to consider the album name as a unique key to an album id ?
I've numerous compilations where the songs don't have the
compilationorpart_of_compilationtag, and it's a pain to select all the songs in the GUI to click the "is a compilation" checkbox each time I'm syncing the library.@X-Ryl669 commented on GitHub (Aug 18, 2016):
I'm asking this, because I could not figure out what way is proper.
Currently, if you have songs like this:
OneArtist:BobCompilation:1Album:Live 2014Path:/path/to/Festival/Live 2014/One.mp3TwoArtist:AliceCompilation:1Album:Live 2014Path:/path/to/Festival/Live 2014/Two.mp3...
AnotherArtist:JohnCompilation:1Album:Live 2014Path:/path/to/John/Live 2014/John - Another.mp3BrickArtist:JohnCompilation:1Album:Live 2014Path:/path/to/John/Live 2014/John - Brick.mp3In ft B and JohnArtist:BCompilation:1Album:Live 2014Path:/path/to/John/Live 2014/John - In feat B.mp3Koel will merge them in a single compilation album with "Various Artist" (which is correct for the 2 first songs, but not the 3 last songs) because
compilationtag is set for all of them (cf. line 57 ofAlbum.php).So, it acts exactly like if
albumtag was a key to the album table (artist_idwill be set toVARIOUS_IDbycompilationtag presence).In that case, why not mark all of them as compilation as soon as an
albumis the same andartistis different ?Also, for example for The Pink Floyd, you've numerous album with the same name, they are not a compilation, only the
yearchanges between them (and theyearis ignored, AFAIK). Koel will merge all songs in a single album.@X-Ryl669 commented on GitHub (Aug 18, 2016):
Or, would the current folder be used to distinguish them, like so (pseudo code):
@BernardGoldberger commented on GitHub (Aug 18, 2016):
Generally I don't like the idea of using the folder structure to determine organization, but maybe we should implement something for compilation albums.
@X-Ryl669 commented on GitHub (Aug 18, 2016):
See PR #414 for an implementation that does that. It's yet to include the changes @phanan proposed 3 days ago for fixing the model too.
@BernardGoldberger commented on GitHub (Sep 6, 2016):
@X-Ryl669 in regards to #414 I agree with @phanan that we should not rely on the folder structure.
Although that it would be lumped into
variousArtitsthe individual songs will still be listed under thecontributing_artist, the only thing that I see as an issue is that in the album view they will be lumped into one album and probably have duplicate tack numbers.having sad that, maybe there is a way that we could use the track number to figure out that there are 2 separate albums, I'm not sure though how it would work or be implemented, let me know what you guys think.
@X-Ryl669 commented on GitHub (Sep 7, 2016):
I'm not sure I'm getting it. Can you give an example here ?
@BernardGoldberger commented on GitHub (Sep 7, 2016):
for which part?
@alex-phillips commented on GitHub (Sep 7, 2016):
@bdgold As far as the tracks being lumped into one album, would adding the metadata for album year fix this issue? I've run into an issue where I have 2 releases of an album (ex: Pink Floyd's The Wall (1979) and The Wall Box Set (2011)) where unless the album year is a subsort on the listing, they are listed as track 1, track 1, track 2, track 2.
I have already done the work, it just needs to be agreed upon that it is a useful piece of metadata: https://github.com/phanan/koel/pull/318
@BernardGoldberger commented on GitHub (Sep 7, 2016):
That will work when you have 2 albums from 2 separate years, but in his case they are from same year. Using track numbers will us at the least determine that there is something weird, maybe we can introduce a section to resolve conflicts.
@X-Ryl669 commented on GitHub (Sep 7, 2016):
Just my 2 cents, but if you only expect to discriminate a song based on its metadata (and not its folder information), then you must support all metadata (and not only some of them) as a unique key to identify a song. Else, you'll have duplicate and you can't tell which is which (example: Pink Floyd from @alex-phillips).
Also, because it's not convenient to have a folder full of tens of thousands of files, I think most people use folder structure to sort their files (and the OS is encouraging to do so, having 40000 files in a folder takes forever to browse in a file explorer etc...), so ignoring this fact is simply
burying our heads in the sand stupidly. I'm not saying it should be the rule, but I'm saying (like I did in the #414) that in case of conflicts, the file hierarchy is precious and use it to solve it. If you store all your file in a single folder, well, it does not break, you can't tell which is which. But if you do use some hierarchy, then Koel'll be able to sort this out by itself.
The issue with using all metadata comes from the fact that some tags are not clearly defined about what they do/are for, and many song have a different philosophy about what to store in them (if they even store something in them), and this creates conflict (see for example, the
albumartistthat's set equal to theartistfor each song of an album), some tags are missing (like thetracknumberfor some songs etc...)Anyway, why would it have duplicate track number ?
What would be the most convenient way to see the track ? Via the "
Various Artist" (is it where you would expect the song ?), or in the original album (and thecontributing_artist) only ?I would prefer the last case.
In that case, when listing the album, you could filter by song id (since there's only a single song in this case), by preferring showing the original
contibutingArtistother theVarious ArtistIMHO, all of this happens because "artist has one or more album has one or more song" is not always true.
In case of complete changes, then I think the relation "song is in album" and "song is from one or more artist" is the only version that's always true.
So the database should say:
song: has anid,album_id,title,path, + the restartist: has anid,song_id,name, + the rest, the primary key being the pairidandsong_idalbum: has anid,name,year+ the restWhen listing by songs, it's easy to join the query and have both the artist + album + song for each song.
When listing by albums, just select the song based on the album
id, and join the query to get the artist for eachsong_id.When listing by artists, just join the songs based on
song_id, and join the query on thealbum_idfor each song found.A compilation is defined when the number of artists for songs with the same
album_idis greater than one (no need to have a column in DB for this, you can deduce it).@BernardGoldberger commented on GitHub (Sep 7, 2016):
Using meta data is not discrimination, its the quite opposite, it allows the song to speak for itself, using the folder structure, is essentially allowing an outsiders influence.
We are planning to bring in more meta data, we just need to figure out which ones are useful, too much is sometimes just too much.
In regards to the folder structure, I understand both sides of the coin, maybe we could compromise and use the .env to enable or disable the feature.
You misunderstood that part I believe, I'm referring too the track number, meaning, if Koel thinks that 2 albums are 1 album, the album will end up having to track
#1and so forth, we could use that to tell us that there are 2 live albums in your case.The entire last part you wrote I simply don't understand, can you try to clarify more?
@X-Ryl669 commented on GitHub (Sep 8, 2016):
This problem shall not happen if you use the complete set of metadata instead of a fewer one (like alex's said). If you ignore a single tag that's present in a file, then you'll end up with conflicts and Koel will think songs are similar.
Using the
tracknumberwill not cut it, since you could have the 2 songs with the sametitle,tracknumber,album,artistbut differentdiscyear. The only way to solve this is not to ignore any tag in the initial file and use all of them for identifying a song.That's for the parsing part : how to end up with correct information in DB...
The last part of my last comment talks about the internal issue with the current DB layout, currently, Koel's song sorting algorithms expects this relation artist>album>song. This is wrong IMHO, and it's probably the cause for all the mismatch and misorder in the album view.
Because compilation album with different artists exists, because songs with different artists exists, the relation is (obviously) wrong.
It should be split in 2 distinct relations, song are part of album and artist participated in song.
Then you can explain all cases from the basic artist > albums > songs, to more complex compilation album with many songs of different artists.
The database format thus should be changed to reflect this, and I wrote how I would do it if I had to do it.
With such a structure, it would also imply that the
/api/datais modified to have 3 main keys (instead of a single one), starting from songs, albums and artists, and remove all the clunky sorting JS code that tries to build album/artist from a list of songs. The sorting would be done by the database with 3 complex queries I've described (that could be cached since the media library does not change often, so it'll even be faster to boot the JS code). The JS code would then follow the "songs" key of the received data when browsing by songs, the "albums" key with browsing by albums, and "artists" key when browsing by artists.I did this in my fork for folders (except that I created a new route for it that's only fetched on first access, instead of when loading the page), and I think it's clean. You don't pay the cost of downloading the folder structure if you don't use it. The same could be done for albums, artists, genres ?, .... Only the songs must be downloaded once to be refered by UID by other structures.
Please notice that I'm not duplicating the data, since they refer to each other by uid, I'm just writing down the relations between element in the JSON object sent (instead of a big 1D list you need to re-parse in JS to figure out the relation between elements, I'm storing the relation in the JSON object and refer to songs by ID).
@BernardGoldberger commented on GitHub (Sep 9, 2016):
Having all tags does not help us if we don't use it, so the question remains, what tags are helpful? we know that
yearis, hopefully that will be implemented.An important note is, that even the
yeartag could just mean that its a compilation of one artists greatest hits, so even here the logic needs to be worked out. Update Actually since its all the same artist it should never be detected as a compilation and therefore not use the year tag.In regards to redesigning the DB, I'm not a super admin when it comes to it, so I will leave it for @phanan and the others to look at, but I can tell you that we would want the migration process to be simple and work, so take that into account with any proposals.
I hope we can all agree on some things soon and get them implemented, we don't need to fix it all immediately but rather come to agreements, implement, then work on the next thing, and we will ultimately get there.
I will try to compile a summary of all that we discussed, so that we can wrap our heads around all of it.
@phanan commented on GitHub (May 7, 2017):
The proposal has been implemented on
masterbranch. @YakovGoldberger if you have time, can you take a look and see if it works according to our discussion? Thanks!@BernardGoldberger commented on GitHub (May 7, 2017):
@phanan yes, will take me though a couple of days, I'll keep you posted.
Thank you.
@BernardGoldberger commented on GitHub (May 7, 2017):
@phanan did anything change in the DB? Do i need to run
php artisan migrate?@phanan commented on GitHub (May 8, 2017):
Yes, there are a couple of db changes. Please make a backup before
proceeding.
On Mon, May 8, 2017 at 00:51 YakovGoldberger notifications@github.com
wrote:
@phanan commented on GitHub (May 8, 2017):
The upgrade commands would be
@BernardGoldberger commented on GitHub (May 19, 2017):
Hmm,
@phanan there doesn't seem to be any change, I also tried a test version with a new database, no change.
@phanan commented on GitHub (May 19, 2017):
No change is a good thing, it means functionality wise the app is still OK.
On Fri, May 19, 2017 at 22:38 YakovGoldberger notifications@github.com
wrote:
@BernardGoldberger commented on GitHub (May 19, 2017):
True 👍