After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 562786 - Add an "initial" field for folder hierarchy
Add an "initial" field for folder hierarchy
Status: RESOLVED FIXED
Product: banshee
Classification: Other
Component: general
git master
Other Linux
: Normal enhancement
: 1.x
Assigned To: Alexander Kojevnikov
Banshee Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-11-30 18:50 UTC by aquavitae69@gmail.com
Modified: 2009-02-22 23:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add %initial% to folder name fields (2.34 KB, patch)
2008-11-30 18:52 UTC, aquavitae69@gmail.com
needs-work Details | Review
%initial% patch update 2 (1.17 KB, patch)
2008-12-02 07:58 UTC, aquavitae69@gmail.com
needs-work Details | Review
updated version (915 bytes, patch)
2009-02-22 22:55 UTC, Alexander Kojevnikov
committed Details | Review

Description aquavitae69@gmail.com 2008-11-30 18:50:42 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.
Comment 1 aquavitae69@gmail.com 2008-11-30 18:52:01 UTC
Created attachment 123706 [details] [review]
Add %initial% to folder name fields
Comment 2 Bertrand Lorentz 2008-12-01 20:00:01 UTC
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.
Comment 3 aquavitae69@gmail.com 2008-12-02 07:41:53 UTC
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.
Comment 4 aquavitae69@gmail.com 2008-12-02 07:58:05 UTC
Created attachment 123775 [details] [review]
%initial% patch update 2

Previous comments taken into account.  Now it only includes the %initial% conversion
Comment 5 Gabriel Burt 2009-01-13 18:00:39 UTC
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!
Comment 6 Alexander Kojevnikov 2009-02-22 22:55:09 UTC
Created attachment 129289 [details] [review]
updated version

Changed according to comment #5
Comment 7 Bertrand Lorentz 2009-02-22 23:34:00 UTC
I changed the "-" to "_" in the variable name to be consistent with the others, and added it to LibrarySchema.cs.
Thanks guys !