diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/tagcache.c | 9 | ||||
-rw-r--r-- | apps/tagcache.h | 1 | ||||
-rw-r--r-- | apps/tagtree.c | 2 |
3 files changed, 12 insertions, 0 deletions
diff --git a/apps/tagcache.c b/apps/tagcache.c index c22091ecf5..e51b1200a2 100644 --- a/apps/tagcache.c +++ b/apps/tagcache.c | |||
@@ -117,6 +117,7 @@ static const int unique_tags[] = { tag_artist, tag_album, tag_genre, | |||
117 | static const int numeric_tags[] = { tag_year, tag_tracknumber, tag_length, | 117 | static const int numeric_tags[] = { tag_year, tag_tracknumber, tag_length, |
118 | tag_bitrate, tag_playcount, tag_rating, tag_playtime, tag_lastplayed, tag_commitid, | 118 | tag_bitrate, tag_playcount, tag_rating, tag_playtime, tag_lastplayed, tag_commitid, |
119 | tag_virt_length_min, tag_virt_length_sec, | 119 | tag_virt_length_min, tag_virt_length_sec, |
120 | tag_virt_playtime_min, tag_virt_playtime_sec, | ||
120 | tag_virt_entryage, tag_virt_autoscore }; | 121 | tag_virt_entryage, tag_virt_autoscore }; |
121 | 122 | ||
122 | /* String presentation of the tags defined in tagcache.h. Must be in correct order! */ | 123 | /* String presentation of the tags defined in tagcache.h. Must be in correct order! */ |
@@ -668,6 +669,14 @@ static long check_virtual_tags(int tag, const struct index_entry *idx) | |||
668 | data = (idx->tag_seek[tag_length]/1000) / 60; | 669 | data = (idx->tag_seek[tag_length]/1000) / 60; |
669 | break; | 670 | break; |
670 | 671 | ||
672 | case tag_virt_playtime_sec: | ||
673 | data = (idx->tag_seek[tag_playtime]/1000) % 60; | ||
674 | break; | ||
675 | |||
676 | case tag_virt_playtime_min: | ||
677 | data = (idx->tag_seek[tag_playtime]/1000) / 60; | ||
678 | break; | ||
679 | |||
671 | case tag_virt_autoscore: | 680 | case tag_virt_autoscore: |
672 | if (idx->tag_seek[tag_length] == 0 | 681 | if (idx->tag_seek[tag_length] == 0 |
673 | || idx->tag_seek[tag_playcount] == 0) | 682 | || idx->tag_seek[tag_playcount] == 0) |
diff --git a/apps/tagcache.h b/apps/tagcache.h index f449f1344e..70677c602b 100644 --- a/apps/tagcache.h +++ b/apps/tagcache.h | |||
@@ -28,6 +28,7 @@ enum tag_type { tag_artist = 0, tag_album, tag_genre, tag_title, | |||
28 | tag_playtime, tag_lastplayed, tag_commitid, | 28 | tag_playtime, tag_lastplayed, tag_commitid, |
29 | /* Virtual tags */ | 29 | /* Virtual tags */ |
30 | tag_virt_length_min, tag_virt_length_sec, | 30 | tag_virt_length_min, tag_virt_length_sec, |
31 | tag_virt_playtime_min, tag_virt_playtime_sec, | ||
31 | tag_virt_entryage, tag_virt_autoscore }; | 32 | tag_virt_entryage, tag_virt_autoscore }; |
32 | 33 | ||
33 | #define TAG_COUNT 17 | 34 | #define TAG_COUNT 17 |
diff --git a/apps/tagtree.c b/apps/tagtree.c index cc8c1456e6..56e8740ac8 100644 --- a/apps/tagtree.c +++ b/apps/tagtree.c | |||
@@ -202,6 +202,8 @@ static int get_tag(int *tag) | |||
202 | MATCH(tag, buf, "length", tag_length); | 202 | MATCH(tag, buf, "length", tag_length); |
203 | MATCH(tag, buf, "Lm", tag_virt_length_min); | 203 | MATCH(tag, buf, "Lm", tag_virt_length_min); |
204 | MATCH(tag, buf, "Ls", tag_virt_length_sec); | 204 | MATCH(tag, buf, "Ls", tag_virt_length_sec); |
205 | MATCH(tag, buf, "Pm", tag_virt_playtime_min); | ||
206 | MATCH(tag, buf, "Ps", tag_virt_playtime_sec); | ||
205 | MATCH(tag, buf, "title", tag_title); | 207 | MATCH(tag, buf, "title", tag_title); |
206 | MATCH(tag, buf, "filename", tag_filename); | 208 | MATCH(tag, buf, "filename", tag_filename); |
207 | MATCH(tag, buf, "tracknum", tag_tracknumber); | 209 | MATCH(tag, buf, "tracknum", tag_tracknumber); |