Index: apps/tagcache.c =================================================================== --- apps/tagcache.c (revision 15365) +++ apps/tagcache.c (working copy) @@ -108,11 +108,12 @@ /* Tags we want to get sorted (loaded to the tempbuf). */ static const int sorted_tags[] = { tag_artist, tag_album, tag_genre, - tag_composer, tag_comment, tag_albumartist, tag_grouping, tag_title }; + tag_composer, tag_comment, tag_albumartist, tag_grouping, tag_yearalbum, + tag_title }; /* 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, tag_comment, tag_albumartist, tag_grouping }; + tag_composer, tag_comment, tag_albumartist, tag_grouping, tag_yearalbum }; /* Numeric tags (we can use these tags with conditional clauses). */ static const int numeric_tags[] = { tag_year, tag_discnumber, tag_tracknumber, tag_length, @@ -123,7 +124,8 @@ /* String presentation of the tags defined in tagcache.h. Must be in correct order! */ static const char *tags_str[] = { "artist", "album", "genre", "title", - "filename", "composer", "comment", "albumartist", "grouping", "year", "discnumber", "tracknumber", + "filename", "composer", "comment", "albumartist", "grouping", "yearalbum", + "year", "discnumber", "tracknumber", "bitrate", "length", "playcount", "rating", "playtime", "lastplayed", "commitid" }; /* Status information of the tagcache. */ @@ -188,7 +190,7 @@ /* For the endianess correction */ static const char *tagfile_entry_ec = "ss"; -static const char *index_entry_ec = "llllllllllllllllllll"; /* (1 + TAG_COUNT) * l */ +static const char *index_entry_ec = "lllllllllllllllllllll"; /* (1 + TAG_COUNT) * l */ static const char *tagcache_header_ec = "lll"; static const char *master_header_ec = "llllll"; @@ -1617,6 +1619,7 @@ int path_length = strlen(path); bool has_albumartist; bool has_grouping; + char *yearalbum, buf[MAX_PATH]; if (cachefd < 0) return ; @@ -1713,6 +1716,14 @@ has_grouping = id3.grouping != NULL && strlen(id3.grouping) > 0; + if (id3.album != NULL && id3.year > 0) + { + snprintf(buf, sizeof buf, "%d %s", id3.year, id3.album); + yearalbum = buf; + } + else + yearalbum = id3.album; + ADD_TAG(entry, tag_filename, &path); ADD_TAG(entry, tag_title, &id3.title); ADD_TAG(entry, tag_artist, &id3.artist); @@ -1736,6 +1747,7 @@ { ADD_TAG(entry, tag_grouping, &id3.title); } + ADD_TAG(entry, tag_yearalbum, &yearalbum); entry.data_length = offset; /* Write the header */ @@ -1765,6 +1777,7 @@ { write_item(id3.title); } + write_item(yearalbum); total_entry_count++; } Index: apps/tagcache.h =================================================================== --- apps/tagcache.h (revision 15371) +++ apps/tagcache.h (working copy) @@ -23,15 +23,16 @@ #include "id3.h" enum tag_type { tag_artist = 0, tag_album, tag_genre, tag_title, - tag_filename, tag_composer, tag_comment, tag_albumartist, tag_grouping, tag_year, - tag_discnumber, tag_tracknumber, tag_bitrate, tag_length, tag_playcount, tag_rating, + tag_filename, tag_composer, tag_comment, tag_albumartist, tag_grouping, + tag_yearalbum, tag_year, tag_discnumber, tag_tracknumber, tag_bitrate, + tag_length, tag_playcount, tag_rating, tag_playtime, tag_lastplayed, tag_commitid, /* Virtual tags */ tag_virt_length_min, tag_virt_length_sec, tag_virt_playtime_min, tag_virt_playtime_sec, tag_virt_entryage, tag_virt_autoscore }; -#define TAG_COUNT 19 +#define TAG_COUNT 20 /* Maximum length of a single tag. */ #define TAG_MAXLEN (MAX_PATH*2) @@ -43,7 +44,7 @@ #define IDX_BUF_DEPTH 64 /* Tag Cache Header version 'TCHxx'. Increment when changing internal structures. */ -#define TAGCACHE_MAGIC 0x5443480b +#define TAGCACHE_MAGIC 0x5443481b /* How much to allocate extra space for ramcache. */ #define TAGCACHE_RESERVE 32768 Index: apps/tagnavi.config =================================================================== --- apps/tagnavi.config (revision 15371) +++ apps/tagnavi.config (working copy) @@ -25,33 +25,33 @@ # Define the A to Z Artist sub menu %menu_start "custom_artist" "Artist A to Z" -"Numeric" -> artist ? artist < "A" -> album -> title = "fmt_title" -"A" -> artist ? artist ^ "A" -> album -> title = "fmt_title" -"B" -> artist ? artist ^ "B" -> album -> title = "fmt_title" -"C" -> artist ? artist ^ "C" -> album -> title = "fmt_title" -"D" -> artist ? artist ^ "D" -> album -> title = "fmt_title" -"E" -> artist ? artist ^ "E" -> album -> title = "fmt_title" -"F" -> artist ? artist ^ "F" -> album -> title = "fmt_title" -"G" -> artist ? artist ^ "G" -> album -> title = "fmt_title" -"H" -> artist ? artist ^ "H" -> album -> title = "fmt_title" -"I" -> artist ? artist ^ "I" -> album -> title = "fmt_title" -"J" -> artist ? artist ^ "J" -> album -> title = "fmt_title" -"K" -> artist ? artist ^ "K" -> album -> title = "fmt_title" -"L" -> artist ? artist ^ "L" -> album -> title = "fmt_title" -"M" -> artist ? artist ^ "M" -> album -> title = "fmt_title" -"N" -> artist ? artist ^ "N" -> album -> title = "fmt_title" -"O" -> artist ? artist ^ "O" -> album -> title = "fmt_title" -"P" -> artist ? artist ^ "P" -> album -> title = "fmt_title" -"Q" -> artist ? artist ^ "Q" -> album -> title = "fmt_title" -"R" -> artist ? artist ^ "R" -> album -> title = "fmt_title" -"S" -> artist ? artist ^ "S" -> album -> title = "fmt_title" -"T" -> artist ? artist ^ "T" -> album -> title = "fmt_title" -"U" -> artist ? artist ^ "U" -> album -> title = "fmt_title" -"V" -> artist ? artist ^ "V" -> album -> title = "fmt_title" -"W" -> artist ? artist ^ "W" -> album -> title = "fmt_title" -"X" -> artist ? artist ^ "X" -> album -> title = "fmt_title" -"Y" -> artist ? artist ^ "Y" -> album -> title = "fmt_title" -"Z" -> artist ? artist ^ "Z" -> album -> title = "fmt_title" +"Numeric" -> artist ? artist < "A" -> yearalbum -> title = "fmt_title" +"A" -> artist ? artist ^ "A" -> yearalbum -> title = "fmt_title" +"B" -> artist ? artist ^ "B" -> yearalbum -> title = "fmt_title" +"C" -> artist ? artist ^ "C" -> yearalbum -> title = "fmt_title" +"D" -> artist ? artist ^ "D" -> yearalbum -> title = "fmt_title" +"E" -> artist ? artist ^ "E" -> yearalbum -> title = "fmt_title" +"F" -> artist ? artist ^ "F" -> yearalbum -> title = "fmt_title" +"G" -> artist ? artist ^ "G" -> yearalbum -> title = "fmt_title" +"H" -> artist ? artist ^ "H" -> yearalbum -> title = "fmt_title" +"I" -> artist ? artist ^ "I" -> yearalbum -> title = "fmt_title" +"J" -> artist ? artist ^ "J" -> yearalbum -> title = "fmt_title" +"K" -> artist ? artist ^ "K" -> yearalbum -> title = "fmt_title" +"L" -> artist ? artist ^ "L" -> yearalbum -> title = "fmt_title" +"M" -> artist ? artist ^ "M" -> yearalbum -> title = "fmt_title" +"N" -> artist ? artist ^ "N" -> yearalbum -> title = "fmt_title" +"O" -> artist ? artist ^ "O" -> yearalbum -> title = "fmt_title" +"P" -> artist ? artist ^ "P" -> yearalbum -> title = "fmt_title" +"Q" -> artist ? artist ^ "Q" -> yearalbum -> title = "fmt_title" +"R" -> artist ? artist ^ "R" -> yearalbum -> title = "fmt_title" +"S" -> artist ? artist ^ "S" -> yearalbum -> title = "fmt_title" +"T" -> artist ? artist ^ "T" -> yearalbum -> title = "fmt_title" +"U" -> artist ? artist ^ "U" -> yearalbum -> title = "fmt_title" +"V" -> artist ? artist ^ "V" -> yearalbum -> title = "fmt_title" +"W" -> artist ? artist ^ "W" -> yearalbum -> title = "fmt_title" +"X" -> artist ? artist ^ "X" -> yearalbum -> title = "fmt_title" +"Y" -> artist ? artist ^ "Y" -> yearalbum -> title = "fmt_title" +"Z" -> artist ? artist ^ "Z" -> yearalbum -> title = "fmt_title" # ^ An empy line ends the menu @@ -127,23 +127,23 @@ # Define the search sub menu %menu_start "search" "Search by..." -"Artist" -> artist ? artist ~ "" -> album -> title = "fmt_title" -"Album Artist" -> albumartist ? albumartist ~ "" -> album -> title = "fmt_title" +"Artist" -> artist ? artist ~ "" -> yearalbum -> title = "fmt_title" +"Album Artist" -> albumartist ? albumartist ~ "" -> yearalbum -> title = "fmt_title" "Album" -> album ? album ~ "" -> title = "fmt_title" "Title" -> title = "fmt_title" ? title ~ "" -"Album by year" -> album ? year = "" -> title = "fmt_title" -"Artist between years" -> artist ? year >= "" & year <= "" -> album -> title = "fmt_title" -"Album between years" -> album ? year >= "" & year <= "" -> title = "fmt_title" +"Album by year" -> yearalbum ? year = "" -> title = "fmt_title" +"Artist between years" -> artist ? year >= "" & year <= "" -> yearalbum -> title = "fmt_title" +"Album between years" -> yearalbum ? year >= "" & year <= "" -> title = "fmt_title" "Filename" -> filename ? filename ~ "" "Score" -> title = "fmt_score" ? autoscore > "" "User Rating" -> title = "fmt_rating" ? rating > "" -"Comment" -> album ? comment ~ "" -> title = "fmt_title" +"Comment" -> yearalbum ? comment ~ "" -> title = "fmt_title" # Define the "same as current" sub menu %menu_start "same" "Same as current" "Directory" -> title ? filename ^ "#directory#" "Title" -> title = "fmt_title" ? title = "#title#" -"Artist" -> album ? artist = "#artist#" -> title = "fmt_title" +"Artist" -> yearalbum ? artist = "#artist#" -> title = "fmt_title" "Album" -> title = "fmt_title" ? album = "#album#" "Composer" -> title = "fmt_title" ? composer = "#composer#" @@ -151,9 +151,9 @@ %menu_start "runtime" "Play history" "Most played (Plays|Score)" -> title = "fmt_mostplayed" ? playcount > "0" "Recently played tracks" -> title = "fmt_lastplayed" ? playcount > "0" -"Never played tracks" -> artist ? playcount == "0" -> album -> title = "fmt_title" -"Favourite artists" -> artist ? playcount > "3" & autoscore > "85" -> album -> title = "fmt_best_tracks" -"Favourite albums" -> album ? playcount > "3" & autoscore > "85" -> title = "fmt_best_tracks" +"Never played tracks" -> artist ? playcount == "0" -> yearalbum -> title = "fmt_title" +"Favourite artists" -> artist ? playcount > "3" & autoscore > "85" -> yearalbum -> title = "fmt_best_tracks" +"Favourite albums" -> yearalbum ? playcount > "3" & autoscore > "85" -> title = "fmt_best_tracks" "Recent favourites" -> title = "fmt_lastplayed" ? playcount > "3" & autoscore > "85" "Forgotten favourites" -> title = "fmt_forgotten" ? playcount > "3" & autoscore > "85" @@ -163,15 +163,15 @@ # Define the title of the main menu %menu_start "main" "Browse by..." -"Artist" -> artist -> album -> title = "fmt_title" -"Album Artist" -> albumartist -> album -> title = "fmt_title" -"Album" -> album -> title = "fmt_title" -"Genre" -> genre -> artist -> album -> title = "fmt_title" -"Composer" -> composer -> album -> title = "fmt_title" +"Artist" -> artist -> yearalbum -> title = "fmt_title" +"Album Artist" -> albumartist -> yearalbum -> title = "fmt_title" +"Album" -> yearalbum -> title = "fmt_title" +"Genre" -> genre -> artist -> yearalbum -> title = "fmt_title" +"Composer" -> composer -> yearalbum -> title = "fmt_title" "Track" -> title "Year" -> year ? year > "0" -> artist -> album -> title = "fmt_title" "User Rating" -> rating -> title = "fmt_title" -"Recently Added" -> album ? entryage < "4" & commitid > "0" -> title = "fmt_title" +"Recently Added" -> yearalbum ? entryage < "4" & commitid > "0" -> title = "fmt_title" "A to Z..." ==> "a2z" "History..." ==> "runtime" "Same as current..." ==> "same" Index: apps/tagtree.c =================================================================== --- apps/tagtree.c (revision 15371) +++ apps/tagtree.c (working copy) @@ -215,6 +215,7 @@ MATCH(tag, buf, "albumartist", tag_albumartist); MATCH(tag, buf, "ensemble", tag_albumartist); MATCH(tag, buf, "grouping", tag_grouping); + MATCH(tag, buf, "yearalbum", tag_yearalbum); MATCH(tag, buf, "genre", tag_genre); MATCH(tag, buf, "length", tag_length); MATCH(tag, buf, "Lm", tag_virt_length_min);