GNOME Bugzilla – Bug 562786
Add an "initial" field for folder hierarchy
Last modified: 2009-02-22 23:34:00 UTC
A number of other music libraries have an field for the artists initial in the directory structure, e.g. [music library]/B/The Beatles/Help/... This appears to be a very minor modification so I've attached a patch which hopefully does it. Basically, I've added a conversion for %initial% and changed TrackInfo.DisplayArtistName to swap "The" around: "Beatles, The". Following from this, it would be nice if the artist list showed the name in this way, but so far I can't figure out how to do that. As far as I can see there should be no negative effects to this.
Created attachment 123706 [details] [review] Add %initial% to folder name fields
Thanks for the patch. A few comments : 1. Please follow the code formatting conventions (indent with spaces, etc.). See the HACKING file for all the details. 2. "(string)t.DisplayArtistName[0].ToString()" doesn't seem right. How about a simple Substring ? 3. I don't think changing the suggested_folders and suggested_files is really necessary. 4. Please also update the FolderPattern and FilePattern descriptions in LibrarySchema.cs 5. I think the "The" swapping should be left out of this patch. I think there's another bug about this, with discussion about a more generic approach to this. This make the %initial% pattern less correct, but let's keep the issues separate.
Thanks for the comments. Appologies about the bad coding - this is the first time ever even really looked at C# so I am not at all familiar with it. Changing suggested_folder and suggested_files is not at all necessary, its just useful for my own setup. I'll remove it, update the patch and repost.
Created attachment 123775 [details] [review] %initial% patch update 2 Previous comments taken into account. Now it only includes the %initial% conversion
This is pretty good, a couple tiny nitpicks: 1) Please rename to "track-artist-initial" from "initial", or better yet change it to "album-artist-initial" and change it to use the AlbumArtist property - this will make this work better for compilation albums 2) you don't need the (string) cast for the .Substring (n, n) call, it returns a string 3) Please remove the last whitespace change in your patch Thanks!
Created attachment 129289 [details] [review] updated version Changed according to comment #5
I changed the "-" to "_" in the variable name to be consistent with the others, and added it to LibrarySchema.cs. Thanks guys !