Rockbox Technical Forums

Rockbox General => Rockbox General Discussion => Topic started by: KindOfBlues71 on October 11, 2007, 02:34:28 PM

Title: Option to display albums in Database by year?
Post by: KindOfBlues71 on October 11, 2007, 02:34:28 PM
I've read through all the posts I could find regarding sorting albums by year in the Database and the only answer given was "no".   This is a function I would really like to have and I was wondering why it's not possible to sort albums by year, only tracks.  I personally don't understand why someone would want to sort tracks by year, but I'm sure they have a good reason!  Any chance of this functionality being available?  If not, is this something that could be added via a patch?  Doubt that it matters but I'm using Rockbox on a 30GB 5g iPod Video.

I've only been using Rockbox for about two months now and I'm really happy with the functionality it provides.  I hope you'll all continue making it both stable and as customizable as possible, which is not an easy task!

-KindOfBlues71
Title: Re: Option to display albums in Database by year?
Post by: Llorean on October 11, 2007, 03:03:40 PM
Add the year into the album name, for example "(1997) This Album" and then when you sort by album name, they'll be sorted by year.

Seriously, it sorts by metadata. The album itself doesn't have metadata, only songs do. You could find an 'Album Year' tag, if one exists, add support for it into the database, and then you could have a list of years, and when you select a year, have a list of albums. Assuming such a tag exists it'd be a workable solution.
Title: Re: Option to display albums in Database by year?
Post by: scharkalvin on October 11, 2007, 04:54:46 PM
There IS a tag for copyright year that you could hijack for that purpose.
Title: Re: Option to display albums in Database by year?
Post by: Llorean on October 11, 2007, 04:57:19 PM
If you're hijacking tags, you may as well just hijack one of the tags already supported in the Rockbox databsae. Just pick one you aren't using and use it.
Title: Re: Option to display albums in Database by year?
Post by: KindOfBlues71 on October 12, 2007, 04:30:58 PM
I understand that the file contains the metadata info, but if you can specify how to sort by artist name and album title, it doesn't make sense why albums cannot be sorted by year.  Especially since selecting a year gives me a list of artists with albums tagged with that year and then under an artist, a list of those albums.  So is that a limitation of the tagnavi syntax or am I way off here (the most likely reason)?  I know the File View settings affect the way files and the database lists things, so is that part of the reason I can't sort albums by year?

Regarding your suggestion to use the Album Year tag, what do you mean by "add support for it into the database"?  Do you mean write a patch or edit tagnavi_custom to look for that tag?  Assuming the database supported the Album Year tag, or I hijacked an already-supported tag, wouldn't that sort the exact same way Year is sorted now?  Your description of how it would sort sounds like it does.

Thanks very much in advance for any explanation, as I'm trying to wrap my head around this.  When it comes to something I'm interesting in learning about, like Rockbox, I like to know "why/why not".

-KindOfBlues71
Title: Re: Option to display albums in Database by year?
Post by: Llorean on October 12, 2007, 05:46:33 PM
I don't understand what you're asking in the first paragraph at all. It sounds like you haven't quite read what I've said.

Albums cannot be sorted by year, because there is no data stored for albums. Data is stored for songs. So what you get is "All songs on this album." What you can do though is have another tag on the songs for "Album Year" or just use an existing tag as it. Then sort first by that tag, then by album name.

The database just stores information about songs. "Albums" don't really exist. All they are is a series of letters that several songs have in common, so you can't store specific information about an album such as its year. But you can, on every song, use a tag to store what year that song's album came out.

And yes, to add a new tag to the database you'd need to make a patch. To "steal" a tag the database already supports, on the other hand, you could just edit the tags in your files, and make a custom tagnavi.
Title: Re: Option to display albums in Database by year?
Post by: countach on October 15, 2007, 10:48:56 AM
^^^

All this is true, but, for example, why not consider the date stored in the first song as the date of the album? Or even in all songs. That would be a method as valid as the one used to retrieve the album's name.

In fact, foobar2000 does it that way.

Title: Re: Option to display albums in Database by year?
Post by: Llorean on October 15, 2007, 05:02:45 PM
There is no method to retrieve the album's name, because no information is stored about the album.

If you have six songs from one album, and in three the album name is misspelled, you will have 3 songs from one album, and 3 from another, and will see two different album names in the list because all it's doing is grouping them by the content of a list of letters, and doesn't know what that list *means* other than it's the list "called" a different list of letters.

You could group them by year, but of course then it would group every song from that year, independent of album. But if you do "Year" then "Album" then you'll see all albums from that year, assuming all your songs have the same year marked on any given album.

Then again, if all your songs had the same year marked, wouldn't that negate the need for this request which was for a separate tag for album date than then normal year tag?

Your statement basically seems to suggest exactly what he doesn't want to do...
Title: Re: Option to display albums in Database by year?
Post by: cc on October 15, 2007, 05:51:42 PM
I understand that the file contains the metadata info, but if you can specify how to sort by artist name and album title, it doesn't make sense why albums cannot be sorted by year.  Especially since selecting a year gives me a list of artists with albums tagged with that year and then under an artist, a list of those albums.  So is that a limitation of the tagnavi syntax or am I way off here (the most likely reason)?  I know the File View settings affect the way files and the database lists things, so is that part of the reason I can't sort albums by year?

If all you want to do is see a list of albums after you select "Year" (instead of a list of artists first), then you could just change this line in .rockbox/tagnavi.config :

 "Year"     -> year ? year > "0" -> artist -> album -> title = "fmt_title"

to this:

 "Year"     -> year ? year > "0" -> album -> title = "fmt_title"

You will have to do the mod each time you update rockbox though...

And it isn't really sorting by album year, if there are songs from different years on an album you will only see the songs from the year you selected when you get to the album.

Is that what you meant?
Title: Re: Option to display albums in Database by year?
Post by: yapper on October 15, 2007, 06:30:43 PM
Wouldn't following this advice avoid the overwriting issue?


Quote
# Tag Browser configuration file, do not edit as changes will be lost!
# Instead, you can modify "/.rockbox/tagnavi_custom.config" which will never
# get overwritten automatically.
Title: Re: Option to display albums in Database by year?
Post by: cc on October 16, 2007, 06:01:15 AM

AFAIK (which is not all that far  ;D ) tagnavi_custom.config only allows you to add new custom menus, not change the default menu.

But, yes, adding a custom menu might also do what he wants.
Title: Re: Option to display albums in Database by year?
Post by: roolku on October 16, 2007, 06:23:10 AM
AFAIK (which is not all that far  ;D ) tagnavi_custom.config only allows you to add new custom menus, not change the default menu.

Not quite true.

You can set the default menu using the keyword %root_menu. I.e the line

%root_menu "custom"

at the end of your your tagnavi_custom.config will set the root_menu to "custom" (which needs to be defined)
Title: Re: Option to display albums in Database by year?
Post by: cc on October 16, 2007, 07:27:03 AM

So it does! Cool. I assumed because the custom file was read before all the other stuff (including rootmenu) was defined that the defaults would overwrite any changes you tried to make.
Title: Re: Option to display albums in Database by year?
Post by: KindOfBlues71 on October 16, 2007, 03:14:54 PM
Quote from: Llorean
I don't understand what you're asking in the first paragraph at all. It sounds like you haven't quite read what I've said.

I've read and understood all your posts.  I asked if the options in the File View settings had an affect on the Database's inability to display albums by year.  I read the Wiki and ensured that Sort Directories and Sort Files was set to "Alphabetical" (which should be renamed to "Alpha-Numeric" since it sorts letters AND numbers in order, but that's off-topic), so I answered my own question and apologize for confusing you.

Quote
Albums cannot be sorted by year, because there is no data stored for albums. Data is stored for songs. So what you get is "All songs on this album." What you can do though is have another tag on the songs for "Album Year" or just use an existing tag as it. Then sort first by that tag, then by album name.

The database just stores information about songs. "Albums" don't really exist. All they are is a series of letters that several songs have in common, so you can't store specific information about an album such as its year. But you can, on every song, use a tag to store what year that song's album came out.

How is using the "Album Year" tag or hijacking another tag is any different than using the "Year" tag.  I understand the difference but aren't both tags, to quote you, "a series of numbers/letters that several songs have in common"?  It'd be a waste of time to creating a patch for an unsupported tag that essentially sorts the same as using the existing "Year" tag.  I'd still have to select a year first to see all albums tagged with that year.

Furthermore, since albums are just "a series of letters that several songs have in common," the same is true of artists.  And the same is true of the year as well, only it's a series of numbers that several songs have in common.  So why can we sort by Artist but restrict those to a certain genre, for example?  You can define a filter/condition/format to display certain Artists and/or Albums, right?  So why can't we use "Year" as a filter/condition/format when displaying albums?


Quote from: countach
All this is true, but, for example, why not consider the date stored in the first song as the date of the album? Or even in all songs. That would be a method as valid as the one used to retrieve the album's name.

In fact, foobar2000 does it that way.

Exactly!


Quote from: Llorean
There is no method to retrieve the album's name, because no information is stored about the album.

If you have six songs from one album, and in three the album name is misspelled, you will have 3 songs from one album, and 3 from another, and will see two different album names in the list because all it's doing is grouping them by the content of a list of letters, and doesn't know what that list *means* other than it's the list "called" a different list of letters.

You could group them by year, but of course then it would group every song from that year, independent of album. But if you do "Year" then "Album" then you'll see all albums from that year, assuming all your songs have the same year marked on any given album.

Then again, if all your songs had the same year marked, wouldn't that negate the need for this request which was for a separate tag for album date than then normal year tag?

Your statement basically seems to suggest exactly what he doesn't want to do...

Actually, countach stated exactly what want to do.  I never requested a separate tag for album date, I only want use the supported Year tag to sort albums chronologically when I select an artist.  You've stated multiple times that it can't be done, but you haven't explained WHY it can't be done.  The Database Wiki shows that the Year tag can be used in Filter, Condition and Formatting.  So it would make sense based on the Wiki that albums should be able to be displayed chronologically by year when you select an artist first, rather than selecting the year first.

Erroneous entries will always mess up the way information is listed, regardless of whether we can sort albums by year or not.  If someone has 300 audio files all tagged with the same year, they're probably not the type of person who cares about listing an artist's albums chronologically by year.  Regardless of how detailed someone is with their tags, we should be able to use the supported tags to "control the structure and layout" of the database (to quote the Database Wiki).  So why can't we?

-KindOfBlues71
Title: Re: Option to display albums in Database by year?
Post by: KindOfBlues71 on October 16, 2007, 04:27:43 PM
Quote from: cc
If all you want to do is see a list of albums after you select "Year" (instead of a list of artists first), then you could just change this line in .rockbox/tagnavi.config :

 "Year"     -> year ? year > "0" -> artist -> album -> title = "fmt_title"

to this:

 "Year"     -> year ? year > "0" -> album -> title = "fmt_title"

You will have to do the mod each time you update rockbox though...

And it isn't really sorting by album year, if there are songs from different years on an album you will only see the songs from the year you selected when you get to the album.

Is that what you meant?

No, what I'd like is to select an artist and see the albums listed chronologically by year.  For example, selecting The Beatles from my list of Artists lists their albums sorted by year:

The Beatles
-KindOfBlues71
Title: Re: Option to display albums in Database by year?
Post by: Llorean on October 16, 2007, 08:38:09 PM
I never stated "You can't sort by year, then by Album". You can, and have been able to for quite some time.

I stated that no information is stored about an album.

I even said [quoute]if you do "Year" then "Album" then you'll see all albums from that year, assuming all your songs have the same year marked on any given album.[/quote] which sounds like exactly what you want.

Given that you could always do this, since about the addition of the tagnavi file, I could only reasonably assume that you wanted it to actually care about the year the album was released, rather than simply hijacking the existing Year tag, since your first post said you'd done thorough research on what you wanted and gotten "No" as a result, and an actual Album Year tag is not currently doable, while apparently what you wanted is.

Most of the flexibility of tagnavi is that you can create nearly any hierarchy of tags and use it, and this is pretty well discussed, so when you said you had researched it, I could only really assume that you'd gotten this basic concept and were looking for a more advanced feature.

Anyway, sorry for making assumptions about what you were saying.
Title: Re: Option to display albums in Database by year?
Post by: KindOfBlues71 on October 16, 2007, 09:25:03 PM
Quote from: Llorean
I never stated "You can't sort by year, then by Album". You can, and have been able to for quite some time.

And I never stated that you did!  Please re-read my post...

Quote
I stated that no information is stored about an album.

Right, metadata is stored in the track - I got it.  I stated several times that I understood.  You said that an album name is a series of letters that several songs have in common, too.  Same goes for artist, right?  And every other tag, right?

Quote
I even said "if you do "Year" then "Album" then you'll see all albums from that year, assuming all your songs have the same year marked on any given album," which sounds like exactly what you want.

No, this is how Rockbox works right now when I select Year.  I've stated many times in this thread that is not what I want to do!  I even posted earlier today exactly what I was wanting to do, sort albums chronologically by year, and even gave an example.  I don't want to sort by one year, two years, ten years, or even a decade.  I want the sorting built-in so that when I click (from Main Menu) Database > Artist > The Beatles, I get the albums listed in chronological order by year.  Again, I don't want to click
Database > Year > 1969 > The Beatles > Abbey Road, nor do I want to click Year > 1969 > Abbey Road.  I want to click Database > Artist > The Beatles and see all the Beatles albums currently in my iPod displayed in chronological order by year.

Quote
Given that you could always do this, since about the addition of the tagnavi file, I could only reasonably assume that you wanted it to actually care about the year the album was released, rather than simply hijacking the existing Year tag, since your first post said you'd done thorough research on what you wanted and gotten "No" as a result, and an actual Album Year tag is not currently doable, while apparently what you wanted is.

In my first post I stated I did a lot of searching for info on sorting albums chronologically by year, for about a week straight.  Many times people simply said no, but without an explanation.  My goal is to find out why and then try and figure out how to make it happen, whether by feature request or by patch.  Since people have posted questions about it there is obviously some interest in this type of sorting.  And I DO want the database to care about the year tag.  I want it to care so damn much that it lists albums in chronological order by year when I select, for example, (from the Main Menu) Database > Artists > The Beatles!

Quote
Most of the flexibility of tagnavi is that you can create nearly any hierarchy of tags and use it, and this is pretty well discussed, so when you said you had researched it, I could only really assume that you'd gotten this basic concept and were looking for a more advanced feature.

So I can create nearly any hierarchy of tags and use it....except to do exactly what I'm wanting it to do: sort albums chronologically by year by clicking (from Main Menu) Database > Artists > The Beatles.

We are obviously not understanding one another and our posts are going in circles.  I've read lots of your posts in other topics and you're an admin for a reason, but you're just not understanding my point I guess.

Btw, I found something in the tagtree.c file that may explain things, guided there from another post about this very same issue.  I'll post about it tomorrow because I'm spent.  We'll continue tomorrow, Llorean.
Title: Re: Option to display albums in Database by year?
Post by: safetydan on October 16, 2007, 09:30:51 PM
This sounds like it comes back to support for sort tags in tagcache. There's a (not working) patch here http://www.rockbox.org/tracker/task/7287 and a really long thread about it here http://forums.rockbox.org/index.php?topic=10689.105

If someone picks up that patch and makes it work it would be awesome since it would let people sort tracks/albums by whatever they want, including year. Assuming they use the TSOA/TSOP tags.
Title: Re: Option to display albums in Database by year?
Post by: pixelma on October 17, 2007, 04:26:46 AM
KindOfBlues71, you said you found a bit of information but since you didn't state what exactly, I thought I could post a link to what helped me to understand it back when I played around with a custom tagnavi file (and wanting to achieve the same).

http://forums.rockbox.org/index.php?topic=9570.msg73668#msg73668
Title: Re: Option to display albums in Database by year?
Post by: roolku on October 17, 2007, 06:20:40 AM
A FILTER (i.e. a level in the database tree that is not the title level and not a custom menu - see http://www.rockbox.org/twiki/bin/view/Main/RobertKukla?topic=DataBase) currently needs to be a single tag. It is used for splitting and sorting.

So in order to achieve your goal you either:

1) create a single tag that contains the year followed by the album (e.g. abuse the comment field)
pro:
- works now without code modification
con:
- needs to be populated manually
- "uses up" a tag

2) implement sort fields where you put the year before the album name
pro:
- quite flexible solution
con:
- need to be populated manually
- complex to implement, as there are no provisions for sorting filters; I also see two implementation options: a) hide and use for sorting only b) treat as normal fields, where the latter is significantly easier to implement
- nearly double the size requirements for the database

3) create a virtual tag that is composed of year and album; a) dynamically and not stored in database b) on update and stored in the database.
pro:
- relatively easy to implement
con:
- 3a) has a performance penalty - need to be tested how severe

4) allow format strings to be used for filters.
pro:
- most flexible
con:
- massive performance overhead

I favour 3) . While it is only the solution to one particular scenario, it is the one the comes up most often (if not the only one) If I find the time I even might have a go.

And no, I don't think we should pick the (year-) tag from a random file to do the sorting - some reasons already given in the thread.

Anyway, just a few thoughts, based on my understanding on how the database works in rockbox - not necessarily a complete list.
Title: Re: Option to display albums in Database by year?
Post by: markun on October 17, 2007, 06:43:28 AM
KindOfBlues71: I also would like my albums to be sorted chronologically. I'll put it on my todo and hope to ever get time to seriously look at it.

For now I just use the file browser and put my albums in folders like this:

Amon Tobin:
Title: Re: Option to display albums in Database by year?
Post by: KindOfBlues71 on October 17, 2007, 01:53:32 PM
Quote from: safetydan
This sounds like it comes back to support for sort tags in tagcache. There's a (not working) patch here http://www.rockbox.org/tracker/task/7287 and a really long thread about it here http://forums.rockbox.org/index.php?topic=10689.105

If someone picks up that patch and makes it work it would be awesome since it would let people sort tracks/albums by whatever they want, including year. Assuming they use the TSOA/TSOP tags.

I've read thru that post a few times before starting this one, and I agree that this should be implemented.  Ultimately it would be great to be able to sort and filter in whatever way you want to!  But that will never happen.


Quote from: pixelma
KindOfBlues71, you said you found a bit of information but since you didn't state what exactly, I thought I could post a link to what helped me to understand it back when I played around with a custom tagnavi file (and wanting to achieve the same).

http://forums.rockbox.org/index.php?topic=9570.msg73668#msg73668

Sorry about that, I was really tired yesterday and needed to crash.  Plus, I only found/read the thread yesterday.  It was started by roolku back on 07/2006, but it still applies today: http://forums.rockbox.org/index.php?topic=5420.0

He found that the tagcache.c file states the following:

Code: [Select]
/* Uniqued tags (we can use these tags with filters and conditional clauses). */
static const int unique_tags[] = { tag_artist, tag_album, tag_genre, tag_composer };

/* Numeric tags (we can use these tags with conditional clauses). */
static const int numeric_tags[] = { tag_year, tag_tracknumber, tag_length, tag_bitrate,
tag_playcount, tag_playtime, tag_lastplayed, tag_virt_autoscore };

So that is the WHY I was looking for.  I guess my next question would be, can the tagcache.c file be edited to add "tag_year" to the list of Uniqued tags, or is a patch required?

Thanks for the link, I'll read thru it...

-KindOfBlues71
Title: Re: Option to display albums in Database by year?
Post by: KindOfBlues71 on October 18, 2007, 05:01:35 PM
Quote from: roolku
A FILTER (i.e. a level in the database tree that is not the title level and not a custom menu - see http://www.rockbox.org/twiki/bin/view/Main/RobertKukla?topic=DataBase) currently needs to be a single tag. It is used for splitting and sorting.

You created the Database wiki, right roolku?  Would you please clarify your reference to the filter definition above?  That definition isn't in the database wiki, and I'm not sure if you're saying the Year tag is used as a filter, or should be.  The Supported Tags section of the wiki shows that the Year tag can be used as a filter, condition and formatting, and I referenced a thread where you showed that the tagcache.c file clearly states that the Year tag can only be used as a condition.

The wiki has the following:
Quote
  • is a tag (see below for supported tags)
  • it will introduce another level in the database tree with entries for all possible values for of the (e.g. all artists)
  • if there is more than one the selection will be limited by the filter above (e.g. if you pick genre "Rock", you will only find "Rock" artists in the next level)
  • if necessary there will also be an entry "" for files without an entry for that tag (e.g. no artists entered)
  • another entry "" will give a shortcut for all the titles selected so far
Your definition states "...currently needs to be a single tag" but the third bullet point above states "if there is more than one filter..."  If a filter is a tag, how can there be only a single tag when the wiki says there can be more than one filter?  Doesn't that mean there can be more than one tag to filter results by?


Quote
So in order to achieve your goal you either:

1) create a single tag that contains the year followed by the album (e.g. abuse the comment field)
pro:
- works now without code modification
con:
- needs to be populated manually
- "uses up" a tag

I might try this with my Beatles albums and see how it does.  The downside is it's time-consuming if doing this for all my files, plus I'm fairly anal about my jazz collection and sometimes put song/album info in the Comments field.  Btw, the manual shows that the Comment tag is unsupported, while the Database wiki shows that it *is* a supported tag.


Quote
2) implement sort fields where you put the year before the album name
pro:
- quite flexible solution
con:
- need to be populated manually
- complex to implement, as there are no provisions for sorting filters; I also see two implementation options: a) hide and use for sorting only b) treat as normal fields, where the latter is significantly easier to implement
- nearly double the size requirements for the database

By "sort fields" are you referring to the TSOA/TSOP tags?  Why would it almost double the database size requirements?


Quote
3) create a virtual tag that is composed of year and album; a) dynamically and not stored in database b) on update and stored in the database.
pro:
- relatively easy to implement
con:
- 3a) has a performance penalty - need to be tested how severe

I'm not exactly sure what you mean by this third option.


Quote
4) allow format strings to be used for filters.
pro:
- most flexible
con:
- massive performance overhead

This sounds like what I'm after!  I'm not a programmer by any stretch of my imagination so I have no idea what would or wouldn't affect performance, but it figures that the most flexible solution would cause performance issues...


Quote
I favour 3) . While it is only the solution to one particular scenario, it is the one the comes up most often (if not the only one) If I find the time I even might have a go.

Please let us know if you do, that would be very cool!


Quote
And no, I don't think we should pick the (year-) tag from a random file to do the sorting - some reasons already given in the thread.

Same reason as Llorean or are you referring to sorting tags?  I don't get peoples' issues w/ using the Year tag because that tag is already being used to browse by specific Year already.  If the Database could look for Artist > Album > Year, in that order, problem solved I'd think.

-KindOfBlues71[/list]
Title: Re: Option to display albums in Database by year?
Post by: roolku on October 18, 2007, 08:12:54 PM
Quote from: roolku
A FILTER (i.e. a level in the database tree that is not the title level and not a custom menu - see http://www.rockbox.org/twiki/bin/view/Main/RobertKukla?topic=DataBase) currently needs to be a single tag. It is used for splitting and sorting.

You created the Database wiki, right roolku?  

No, but I wrote the (initial version of the) syntax section.

Would you please clarify your reference to the filter definition above?  That definition isn't in the database wiki, and I'm not sure if you're saying the Year tag is used as a filter, or should be.

The year tag can be used as a filter. If done so it will create a menu level listing the years from all titles that passed the previous filter in the chain.

The Supported Tags section of the wiki shows that the Year tag can be used as a filter, condition and formatting, and I referenced a thread where you showed that the tagcache.c file clearly states that the Year tag can only be used as a condition.

At the time of writing there was no support for numerical tags to be used as filters at all, only strings. This has meanwhile been implemented.

The wiki has the following:
Quote
  • is a tag (see below for supported tags)
  • it will introduce another level in the database tree with entries for all possible values for of the (e.g. all artists)
  • if there is more than one the selection will be limited by the filter above (e.g. if you pick genre "Rock", you will only find "Rock" artists in the next level)
  • if necessary there will also be an entry "" for files without an entry for that tag (e.g. no artists entered)
  • another entry "" will give a shortcut for all the titles selected so far
Your definition states "...currently needs to be a single tag" but the third bullet point above states "if there is more than one filter..."

If a filter is a tag, how can there be only a single tag when the wiki says there can be more than one filter?  Doesn't that mean there can be more than one tag to filter results by?

Yes, every filter is a single tag, but you can have many filters (each being a single tag and introducing a new menu level).

Quote
So in order to achieve your goal you either:

1) create a single tag that contains the year followed by the album (e.g. abuse the comment field)
pro:
- works now without code modification
con:
- needs to be populated manually
- "uses up" a tag

I might try this with my Beatles albums and see how it does.  The downside is it's time-consuming if doing this for all my files, plus I'm fairly anal about my jazz collection and sometimes put song/album info in the Comments field.  

Yes, I agree, it is only a workaround.


Btw, the manual shows that the Comment tag is unsupported, while the Database wiki shows that it *is* a supported tag.

The comment tag is supported, I implemented it. It seems, the manual could do with some updating.

Quote
2) implement sort fields where you put the year before the album name
pro:
- quite flexible solution
con:
- need to be populated manually
- complex to implement, as there are no provisions for sorting filters; I also see two implementation options: a) hide and use for sorting only b) treat as normal fields, where the latter is significantly easier to implement
- nearly double the size requirements for the database

By "sort fields" are you referring to the TSOA/TSOP tags?  Why would it almost double the database size requirements?

Yes, I believe these are the tags used in id3v2 tags - they will be different for different file formats.
Double, because in addition to the display version you would need to store the sort version for every tag. E.g.
"The Artist" and "Artist, The"

Quote
3) create a virtual tag that is composed of year and album; a) dynamically and not stored in database b) on update and stored in the database.
pro:
- relatively easy to implement
con:
- 3a) has a performance penalty - need to be tested how severe

I'm not exactly sure what you mean by this third option.

Virtual database tags don't have and equivalent that is part of the audio file, but instead they are "calculated" from such tags. E.g. the minutes and seconds tags are such virtual tags.

Quote
I favour 3) . While it is only the solution to one particular scenario, it is the one the comes up most often (if not the only one) If I find the time I even might have a go.

Please let us know if you do, that would be very cool!

It will be on the patch tracker and possibly be committed if there are no objections. But no promises.

Quote
And no, I don't think we should pick the (year-) tag from a random file to do the sorting - some reasons already given in the thread.

Same reason as Llorean or are you referring to sorting tags?  I don't get peoples' issues w/ using the Year tag because that tag is already being used to browse by specific Year already.

I am referring to the fact that is not guaranteed that tracks with the same album name have the same year.

If you have SQL background, you want something like

SELECT year+album FROM database GROUP BY album;

which doesn't work. You would need

SELECT year+album FROM database GROUP BY year+album;

i.e. a mechanism that combines the year and the album.


If the Database could look for Artist > Album > Year, in that order, problem solved I'd think.


If you mean as a chain of different filters, it can already do that, although it doesn't strike me as very useful as typically all tracks on an album are from the same year.
Title: Re: Option to display albums in Database by year?
Post by: KindOfBlues71 on October 20, 2007, 09:19:10 AM
Quote from: markun
KindOfBlues71: I also would like my albums to be sorted chronologically. I'll put it on my todo and hope to ever get time to seriously look at it.

I'll hope you do as well!  Maybe team up with roolku if your idea for implementing this is similar?  Two heads, and all that!

Quote
For now I just use the file browser and put my albums in folders like this:

Amon Tobin:
  • [1996] Adventures In Foam
  • [1997] Bricolage
  • [1998] Permutation
  • [2000] Supermodified
  • [2002] Out From Out Where

I know it's faster to turn the database options off and use the file browser, but I rather like using the database features.  I still use iTunes to load stuff on my iPod and use the Apple firmware for video podcasts, TV shows and movies.

-KindOfBlues71
Title: Re: Option to display albums in Database by year?
Post by: roolku on October 30, 2007, 10:41:37 AM
Check out http://www.rockbox.org/tracker/task/8051 to see if it is what you want.
Title: Re: Option to display albums in Database by year?
Post by: KindOfBlues71 on October 31, 2007, 09:08:16 AM
Thanks for working on this roolku!  I put in a request with tdtooke to consider adding it to his custom build.  Unfortunately I don't know how to compile my own custom build yet, so I can't test this myself.

I apologize in advance if the answer is obvious, but does this patch pull the year from the Year tag or the Album Year tag?

Thanks again!
-KindOfBlues71
Title: Re: Option to display albums in Database by year?
Post by: roolku on October 31, 2007, 09:37:08 AM
Rockbox doesn't have a concept of album year, so it is the year tag.
Title: Re: Option to display albums in Database by year?
Post by: shoe on November 02, 2007, 02:08:11 AM
I am compiling this into a build now.  Assuming it works, thanks a million!
Title: Re: Option to display albums in Database by year?
Post by: KindOfBlues71 on November 06, 2007, 04:35:36 PM
@ roolku- Thanks a million for this patch!  tdtooke added it to his Underground custom build and it works great!  

Please don't kill me for asking, but is it possible to hide the year when viewing albums?  I've tried messing with the tagnavi_custom file but can't seem to figure out if this is possible or not.

-KindOfBlues71
Title: Re: Option to display albums in Database by year?
Post by: shoe on November 06, 2007, 05:24:52 PM
I don't believe its possible using the tagnavi.config stuff.  The %strip keyword is only useful for displaying actual tracks, from what I understand.
Title: Re: Option to display albums in Database by year?
Post by: SojiOkita on July 19, 2011, 02:46:43 PM
Hi,

I'm very interrested by this patch but I have absolutely no idea how to use it.

As the discussion is 4 years old:
- is it possible to do it easily?
- what I want is sorting by album date, but as I use a clip+ with a little screen, it would be better if the year isn't displayed... is it still not possible?

Thanks in advance for your answers.
Title: Re: Option to display albums in Database by year?
Post by: chileboy on August 16, 2011, 12:28:19 PM
Have a look at my post in this thread (http://forums.rockbox.org/index.php/topic,26909.msg176918.html#msg176918) for an example on how to accomplish this.  You should be able to modify it a bit so that the year isn't actually displayed.
Title: Re: Option to display albums in Database by year?
Post by: chris_s on March 13, 2021, 03:57:54 PM
The solution I've ended up with and prefer is to use the comments tag for this.

I ran a script that iterates over all audio files in my Rockbox music folder and copies the album tag to the comments tag, then prefixes it with the highest value it finds in the year tag of any other tracks from the same album (by the same album artist). Then I can browse through the albums of an album artist by year using:

Code: [Select]
"Albums by year" -> albumartist -> comment -> title = "fmt_title"
in my tagnavi.config

I had previously used the "yearalbum" patch but found it lacking due to the fact that it would split up albums that contained tracks from different years.
Title: Re: Option to display albums in Database by year?
Post by: chris_s on November 20, 2021, 07:45:26 AM
The solution I've ended up with and prefer is to use the comments tag for this.

I ran a script that iterates over all audio files in my Rockbox music folder and copies the album tag to the comments tag, then prefixes it with the highest value it finds in the year tag of any other tracks from the same album (by the same album artist). Then I can browse through the albums of an album artist by year using:

Code: [Select]
"Albums by year" -> albumartist -> comment -> title = "fmt_title"
in my tagnavi.config

I had previously used the "yearalbum" patch but found it lacking due to the fact that it would split up albums that contained tracks from different years.
Turns out I'll be using the "yearalbum" patch again, only slightly modified (g3732 on Gerrit if anyone's interested). In the end, while I previously hadn't been happy when an album with tracks from different years was split apart,  I didn't want to lose the comments tag either – especially since it forced me to keep different versions of my files on the DAP which turned syncing into a bit of a chore. So I've made a trivial modification to the patch such that it uses the year tag by default but also looks at the beginning of the comments tag. If it finds a prefix that fits this pattern: [album:1999] it uses the number from that for the yearalbum tag. That has the advantage of letting me still use the comments tag for additional purposes.

If someone wanted to put more work into it, a clean solution would probably be to compute the “album year” when initializing the database by iterating over all tracks with the same album artist and album title and then saving the highest number to the yearalbum tag for each of the album’s tracks. Then you wouldn't even have to use the slightly hacky comments-prefix approach.