Extract album artist from libtags-processed files

custom
jacqueline 1 year ago
parent 6b9a513214
commit 04ff8bf492
  1. 4
      lib/libtags/id3v2.c
  2. 1
      lib/libtags/tags.h
  3. 2
      lib/libtags/vorbis.c
  4. 2
      src/database/database.cpp
  5. 2
      src/database/tag_parser.cpp

@ -19,8 +19,10 @@ v2cb(Tagctx *ctx, char *k, char *v)
k++; k++;
if(strcmp(k, "AL") == 0 || strcmp(k, "ALB") == 0) if(strcmp(k, "AL") == 0 || strcmp(k, "ALB") == 0)
txtcb(ctx, Talbum, k-1, v); txtcb(ctx, Talbum, k-1, v);
else if(strcmp(k, "PE1") == 0 || strcmp(k, "PE2") == 0 || strcmp(k, "P1") == 0 || strcmp(k, "P2") == 0) else if(strcmp(k, "PE1") == 0 || strcmp(k, "P1") == 0)
txtcb(ctx, Tartist, k-1, v); txtcb(ctx, Tartist, k-1, v);
else if(strcmp(k, "PE2") == 0 || strcmp(k, "P2") == 0)
txtcb(ctx, Talbumartist, k-1, v);
else if(strcmp(k, "IT2") == 0 || strcmp(k, "T2") == 0) else if(strcmp(k, "IT2") == 0 || strcmp(k, "T2") == 0)
txtcb(ctx, Ttitle, k-1, v); txtcb(ctx, Ttitle, k-1, v);
else if(strcmp(k, "YE") == 0 || strcmp(k, "YER") == 0 || strcmp(k, "DRC") == 0) else if(strcmp(k, "YE") == 0 || strcmp(k, "YER") == 0 || strcmp(k, "DRC") == 0)

@ -10,6 +10,7 @@ enum
{ {
Tunknown = -1, Tunknown = -1,
Tartist, Tartist,
Talbumartist,
Talbum, Talbum,
Ttitle, Ttitle,
Tdate, /* "2014", "2015/02/01", but the year goes first */ Tdate, /* "2014", "2015/02/01", but the year goes first */

@ -14,6 +14,8 @@ cbvorbiscomment(Tagctx *ctx, char *k, char *v){
txtcb(ctx, Ttitle, k, v); txtcb(ctx, Ttitle, k, v);
else if(cistrcmp(k, "artist") == 0) else if(cistrcmp(k, "artist") == 0)
txtcb(ctx, Tartist, k, v); txtcb(ctx, Tartist, k, v);
else if(cistrcmp(k, "albumartist") == 0)
txtcb(ctx, Talbumartist, k, v);
else if(cistrcmp(k, "tracknumber") == 0) else if(cistrcmp(k, "tracknumber") == 0)
txtcb(ctx, Ttrack, k, v); txtcb(ctx, Ttrack, k, v);
else if(cistrcmp(k, "date") == 0) else if(cistrcmp(k, "date") == 0)

@ -55,7 +55,7 @@ static SingletonEnv<leveldb::EspEnv> sEnv;
static const char kDbPath[] = "/.tangara-db"; static const char kDbPath[] = "/.tangara-db";
static const char kKeyDbVersion[] = "schema_version"; static const char kKeyDbVersion[] = "schema_version";
static const uint8_t kCurrentDbVersion = 4; static const uint8_t kCurrentDbVersion = 5;
static const char kKeyCustom[] = "U\0"; static const char kKeyCustom[] = "U\0";
static const char kKeyCollator[] = "collator"; static const char kKeyCollator[] = "collator";

@ -37,6 +37,8 @@ static auto convert_tag(int tag) -> std::optional<Tag> {
return Tag::kTitle; return Tag::kTitle;
case Tartist: case Tartist:
return Tag::kArtist; return Tag::kArtist;
case Talbumartist:
return Tag::kAlbumArtist;
case Talbum: case Talbum:
return Tag::kAlbum; return Tag::kAlbum;
case Ttrack: case Ttrack:

Loading…
Cancel
Save