From 9cd88b754f57118dcdf7945a39c463f36a036984 Mon Sep 17 00:00:00 2001 From: waker Date: Sun, 1 May 2011 13:00:08 +0200 Subject: fixed updating Tags field in track properties after rewriting tags --- junklib.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'junklib.c') diff --git a/junklib.c b/junklib.c index 0ed85419..f1fda819 100644 --- a/junklib.c +++ b/junklib.c @@ -3381,6 +3381,8 @@ junk_rewrite_tags (playItem_t *it, uint32_t junk_flags, int id3v2_version, const DB_FILE *fp = NULL; FILE *out = NULL; + uint32_t item_flags = pl_get_item_flags (it); + // get options int strip_id3v2 = junk_flags & JUNK_STRIP_ID3V2; int strip_id3v1 = junk_flags & JUNK_STRIP_ID3V1; @@ -3713,6 +3715,28 @@ junk_rewrite_tags (playItem_t *it, uint32_t junk_flags, int id3v2_version, const } } + if (strip_id3v1 && !write_id3v1) { + item_flags &= ~DDB_TAG_ID3V1; + } + if (strip_id3v2 && !write_id3v2) { + item_flags &= ~(DDB_TAG_ID3V22|DDB_TAG_ID3V23|DDB_TAG_ID3V24); + } + if (strip_apev2 && !write_apev2) { + item_flags &= ~DDB_TAG_APEV2; + } + + if (write_id3v1) { + item_flags |= DDB_TAG_ID3V1; + } + if (write_id3v2) { + item_flags &= ~(DDB_TAG_ID3V22|DDB_TAG_ID3V23|DDB_TAG_ID3V24); + item_flags |= id3v2_version == 3 ? DDB_TAG_ID3V23 : DDB_TAG_ID3V24; + } + if (write_apev2) { + item_flags |= DDB_TAG_APEV2; + } + + pl_set_item_flags (it, item_flags); err = 0; error: if (fp) { -- cgit v1.2.3