Album folder format support: {None}

This commit is contained in:
Yaronzz
2021-12-27 17:37:28 +08:00
parent ba1a559a4b
commit 6399cab7c4
4 changed files with 9 additions and 3 deletions
+2
View File
@@ -73,6 +73,7 @@
| {NumberOfVolumes} | 1 |
| {ReleaseDate} | 1963-03-22 |
| {RecordType} | ALBUM |
| {None} | |
### Track
@@ -80,6 +81,7 @@
| ----------------- | ------------------------------------------ |
| {TrackNumber} | 01 |
| {ArtistName} | The Beatles |
| {ArtistsName} | The Beatles |
| {TrackTitle} | I Saw Her Standing There (Remastered 2009) |
| {ExplicitFlag} | (*Explicit*) |
| {AlbumYear} | 1963 |
+1 -1
View File
@@ -309,7 +309,7 @@ def main():
if __name__ == "__main__":
# debug()
main()
main()
# test example
# track 70973230 77798028 212657
# video 155608351 188932980
+5 -2
View File
@@ -105,7 +105,7 @@ def getAlbumPath(conf: Settings, album):
if conf.addTypeFolder:
base = base + 'Album/'
artist = aigpy.path.replaceLimitChar(getArtistsName(album.artists), '-')
albumArtistName = album.artist.name if album.artist is not None else "None"
albumArtistName = album.artist.name if album.artist is not None else ""
# album folder pre: [ME][ID]
flag = API.getFlag(album, Type.Album, True, "")
if conf.audioQuality != AudioQuality.Master:
@@ -139,6 +139,7 @@ def getAlbumPath(conf: Settings, album):
retpath = retpath.replace(R"{NumberOfVolumes}", str(album.numberOfVolumes))
retpath = retpath.replace(R"{ReleaseDate}", album.releaseDate)
retpath = retpath.replace(R"{RecordType}", album.type)
retpath = retpath.replace(R"{None}", "")
retpath = stripPath(retpath.strip())
return base + retpath
@@ -166,7 +167,8 @@ def getTrackPath(conf: Settings, track, stream, album=None, playlist=None):
if playlist is not None and conf.usePlaylistFolder:
number = __getIndexStr__(track.trackNumberOnPlaylist)
# artist
artist = aigpy.path.replaceLimitChar(getArtistsName(track.artists), '-')
artists = aigpy.path.replaceLimitChar(getArtistsName(track.artists), '-')
artist = track.artist.name if track.artist is not None else ""
# title
title = track.title
if not aigpy.string.isNull(track.version):
@@ -186,6 +188,7 @@ def getTrackPath(conf: Settings, track, stream, album=None, playlist=None):
retpath = Settings.getDefaultTrackFileFormat()
retpath = retpath.replace(R"{TrackNumber}", number)
retpath = retpath.replace(R"{ArtistName}", artist.strip())
retpath = retpath.replace(R"{ArtistsName}", artists.strip())
retpath = retpath.replace(R"{TrackTitle}", title)
retpath = retpath.replace(R"{ExplicitFlag}", explicit)
retpath = retpath.replace(R"{AlbumYear}", year)
+1
View File
@@ -2,6 +2,7 @@ TYPE tidal-dl
USE pip3 install tidal-dl --upgrade
- [X] Settings: add type-folder(eg Album/Video/Playlist)
- [x] Album folder format support: {None}
#### v2021-11-30
- [x] Add language:Japanese