save extra tags

+ port: streaming
This commit is contained in:
cwilvx
2024-06-24 20:48:13 +03:00
parent c42ec4dcde
commit 3593b205eb
6 changed files with 69 additions and 63 deletions
+1 -1
View File
@@ -62,7 +62,7 @@ class IndexAlbums:
album["created_dates"].append(track.last_mod)
if track.genre:
album["genres"].append(track.genre)
album["genres"].extend(track.genre)
for album in albums.values():
album["date"] = min(album["dates"])
+16 -1
View File
@@ -2,7 +2,9 @@ from dataclasses import dataclass
import os
from io import BytesIO
from pathlib import Path
from pprint import pprint
import re
import sys
import pendulum
from PIL import Image, UnidentifiedImageError
@@ -318,6 +320,20 @@ def get_tags(filepath: str):
*[a["name"] for a in tags.artists], tags.album, tags.title
)
more_extra = {
"audio_offset": tags.audio_offset,
"bitdepth": tags.bitdepth,
"composer": tags.composer,
"channels": tags.channels,
"comment": tags.comment,
"disc_total": tags.disc_total,
"filesize": tags.filesize,
"samplerate": tags.samplerate,
"track_total": tags.track_total,
}
tags.extra = {**tags.extra, **more_extra}
tags = tags.__dict__
# delete all tag properties that start with _ (tinytag internals)
@@ -332,7 +348,6 @@ def get_tags(filepath: str):
"comment",
"composer",
"disc_total",
"extra",
"samplerate",
"track_total",
"year",