Added track id as metadata to be written to track file itself using key tag
This commit is contained in:
parent
b701d9307c
commit
b67763c2df
1 changed files with 15 additions and 1 deletions
|
@ -22,12 +22,14 @@ class Album(Collection):
|
||||||
album = api.get_metadata_4_album(AlbumId.from_base62(b62_id))
|
album = api.get_metadata_4_album(AlbumId.from_base62(b62_id))
|
||||||
for disc in album.disc:
|
for disc in album.disc:
|
||||||
for track in disc.track:
|
for track in disc.track:
|
||||||
|
metadata = [MetadataEntry("key", bytes_to_base62(track.gid))]
|
||||||
self.playables.append(
|
self.playables.append(
|
||||||
PlayableData(
|
PlayableData(
|
||||||
PlayableType.TRACK,
|
PlayableType.TRACK,
|
||||||
bytes_to_base62(track.gid),
|
bytes_to_base62(track.gid),
|
||||||
config.album_library,
|
config.album_library,
|
||||||
config.output_album,
|
config.output_album,
|
||||||
|
metadata,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -44,12 +46,14 @@ class Artist(Collection):
|
||||||
album = api.get_metadata_4_album(AlbumId.from_hex(album_group.album[0].gid))
|
album = api.get_metadata_4_album(AlbumId.from_hex(album_group.album[0].gid))
|
||||||
for disc in album.disc:
|
for disc in album.disc:
|
||||||
for track in disc.track:
|
for track in disc.track:
|
||||||
|
metadata = [MetadataEntry("key", bytes_to_base62(track.gid))]
|
||||||
self.playables.append(
|
self.playables.append(
|
||||||
PlayableData(
|
PlayableData(
|
||||||
PlayableType.TRACK,
|
PlayableType.TRACK,
|
||||||
bytes_to_base62(track.gid),
|
bytes_to_base62(track.gid),
|
||||||
config.album_library,
|
config.album_library,
|
||||||
config.output_album,
|
config.output_album,
|
||||||
|
metadata,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -58,12 +62,14 @@ class Show(Collection):
|
||||||
def __init__(self, b62_id: str, api: ApiClient, config: Config = Config()):
|
def __init__(self, b62_id: str, api: ApiClient, config: Config = Config()):
|
||||||
show = api.get_metadata_4_show(ShowId.from_base62(b62_id))
|
show = api.get_metadata_4_show(ShowId.from_base62(b62_id))
|
||||||
for episode in show.episode:
|
for episode in show.episode:
|
||||||
|
metadata = [MetadataEntry("key", bytes_to_base62(episode.gid))]
|
||||||
self.playables.append(
|
self.playables.append(
|
||||||
PlayableData(
|
PlayableData(
|
||||||
PlayableType.EPISODE,
|
PlayableType.EPISODE,
|
||||||
bytes_to_base62(episode.gid),
|
bytes_to_base62(episode.gid),
|
||||||
config.podcast_library,
|
config.podcast_library,
|
||||||
config.output_podcast,
|
config.output_podcast,
|
||||||
|
metadata,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -77,6 +83,7 @@ class Playlist(Collection):
|
||||||
playable_type = split[1]
|
playable_type = split[1]
|
||||||
playable_id = split[2]
|
playable_id = split[2]
|
||||||
metadata = [
|
metadata = [
|
||||||
|
MetadataEntry("key", playable_id),
|
||||||
MetadataEntry("playlist", playlist.attributes.name),
|
MetadataEntry("playlist", playlist.attributes.name),
|
||||||
MetadataEntry("playlist_length", playlist.length),
|
MetadataEntry("playlist_length", playlist.length),
|
||||||
MetadataEntry("playlist_owner", playlist.owner_username),
|
MetadataEntry("playlist_owner", playlist.owner_username),
|
||||||
|
@ -115,20 +122,27 @@ class Playlist(Collection):
|
||||||
|
|
||||||
class Track(Collection):
|
class Track(Collection):
|
||||||
def __init__(self, b62_id: str, api: ApiClient, config: Config = Config()):
|
def __init__(self, b62_id: str, api: ApiClient, config: Config = Config()):
|
||||||
|
metadata = [MetadataEntry("key", b62_id)]
|
||||||
self.playables.append(
|
self.playables.append(
|
||||||
PlayableData(
|
PlayableData(
|
||||||
PlayableType.TRACK, b62_id, config.album_library, config.output_album
|
PlayableType.TRACK,
|
||||||
|
b62_id,
|
||||||
|
config.album_library,
|
||||||
|
config.output_album,
|
||||||
|
metadata,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class Episode(Collection):
|
class Episode(Collection):
|
||||||
def __init__(self, b62_id: str, api: ApiClient, config: Config = Config()):
|
def __init__(self, b62_id: str, api: ApiClient, config: Config = Config()):
|
||||||
|
metadata = [MetadataEntry("key", b62_id)]
|
||||||
self.playables.append(
|
self.playables.append(
|
||||||
PlayableData(
|
PlayableData(
|
||||||
PlayableType.EPISODE,
|
PlayableType.EPISODE,
|
||||||
b62_id,
|
b62_id,
|
||||||
config.podcast_library,
|
config.podcast_library,
|
||||||
config.output_podcast,
|
config.output_podcast,
|
||||||
|
metadata,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Reference in a new issue