Moved some stuff and changed some things
This commit is contained in:
@ -10,7 +10,7 @@
|
||||
"createStructurePlaylist": false,
|
||||
"createSingleFolder": false,
|
||||
"saveFullArtists": false,
|
||||
"padTrack": true,
|
||||
"padTracks": true,
|
||||
"paddingSize": "0",
|
||||
"illegalCharacterReplacer": "_",
|
||||
"queueConcurrency": 3,
|
||||
@ -26,8 +26,7 @@
|
||||
"coverImageTemplate": "",
|
||||
"artistImageTemplate": "",
|
||||
"multitagSeparator": "default",
|
||||
"dateFormat": "0",
|
||||
"dateFormatYear": "4",
|
||||
"dateFormat": "YMD",
|
||||
"savePlaylistAsCompilation": false,
|
||||
"removeAlbumVersion": false,
|
||||
"moveFeaturedToTitle": false,
|
||||
|
@ -150,7 +150,7 @@ def getTrackData(trackAPI):
|
||||
}
|
||||
track['album']['trackTotal'] = albumAPI2['NUMBER_TRACK']
|
||||
track['album']['discTotal'] = albumAPI2['NUMBER_DISK']
|
||||
track['album']['recordType'] = trackAPI['TYPE']
|
||||
track['album']['recordType'] = "Album"
|
||||
track['album']['barcode'] = "Unknown"
|
||||
track['album']['label'] = albumAPI2['LABEL_NAME'] if 'LABEL_NAME' in albumAPI2 else "Unknown"
|
||||
if not 'pic' in track['album']:
|
||||
@ -174,10 +174,11 @@ def getTrackData(trackAPI):
|
||||
track['artist'] = {}
|
||||
track['artists'] = []
|
||||
for artist in trackAPI2['contributors']:
|
||||
track['artists'].append(artist['name'])
|
||||
if not artist['role'] in track['artist']:
|
||||
track['artist'][artist['role']] = []
|
||||
track['artist'][artist['role']].append(artist['name'])
|
||||
if artist['id'] != 5080:
|
||||
track['artists'].append(artist['name'])
|
||||
if not artist['role'] in track['artist']:
|
||||
track['artist'][artist['role']] = []
|
||||
track['artist'][artist['role']].append(artist['name'])
|
||||
|
||||
if not 'discTotal' in track['album'] or not track['album']['discTotal']:
|
||||
if not albumAPI2:
|
||||
|
@ -1,49 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
import re
|
||||
|
||||
def getIDFromLink(link, type):
|
||||
if '?' in link:
|
||||
link = link[:link.find('?')]
|
||||
|
||||
if link.startswith("http") and 'open.spotify.com/' in link:
|
||||
if type == "spotifyplaylist":
|
||||
return link[link.find("/playlist/") + 10]
|
||||
if type == "spotifytrack":
|
||||
return link[link.find("/track/") + 7]
|
||||
if type == "spotifyalbum":
|
||||
return link[link.find("/album/") + 7]
|
||||
elif link.startswith("spotify:"):
|
||||
if type == "spotifyplaylist":
|
||||
return link[link.find("playlist:") + 9]
|
||||
if type == "spotifytrack":
|
||||
return link[link.find("track:") + 6]
|
||||
if type == "spotifyalbum":
|
||||
return link[link.find("album:") + 6]
|
||||
elif type == "artisttop":
|
||||
return re.search(r"\/artist\/(\d+)\/top_track", link)[1]
|
||||
else:
|
||||
return link[link.rfind("/") + 1:]
|
||||
|
||||
|
||||
def getTypeFromLink(link):
|
||||
type = ''
|
||||
if 'spotify' in link:
|
||||
type = 'spotify'
|
||||
if 'playlist' in link:
|
||||
type += 'playlist'
|
||||
elif 'track' in link:
|
||||
type += 'track'
|
||||
elif 'album' in link:
|
||||
type += 'album'
|
||||
elif 'deezer' in link:
|
||||
if '/track' in link:
|
||||
type = 'track'
|
||||
elif '/playlist' in link:
|
||||
type = 'playlist'
|
||||
elif '/album' in link:
|
||||
type = 'album'
|
||||
elif re.search("\/artist\/(\d+)\/top_track", link):
|
||||
type = 'artisttop'
|
||||
elif '/artist' in link:
|
||||
type = 'artist'
|
||||
return type
|
Reference in New Issue
Block a user