mirror of
https://gitlab.com/RemixDev/deemix-py.git
synced 2024-12-29 11:06:14 +00:00
Expose explicit flag in queue
This commit is contained in:
parent
798dcdd3d9
commit
4a85bf5b64
|
@ -1,9 +1,10 @@
|
|||
class QueueItem:
|
||||
def __init__(self, id=None, bitrate=None, title=None, artist=None, cover=None, size=None, type=None, settings=None, queueItemDict=None):
|
||||
def __init__(self, id=None, bitrate=None, title=None, artist=None, cover=None, explicit=False, size=None, type=None, settings=None, queueItemDict=None):
|
||||
if queueItemDict:
|
||||
self.title = queueItemDict['title']
|
||||
self.artist = queueItemDict['artist']
|
||||
self.cover = queueItemDict['cover']
|
||||
self.explicit = queueItemDict['explicit']
|
||||
self.size = queueItemDict['size']
|
||||
self.type = queueItemDict['type']
|
||||
self.id = queueItemDict['id']
|
||||
|
@ -18,6 +19,7 @@ class QueueItem:
|
|||
self.title = title
|
||||
self.artist = artist
|
||||
self.cover = cover
|
||||
self.explicit = explicit
|
||||
self.size = size
|
||||
self.type = type
|
||||
self.id = id
|
||||
|
@ -37,6 +39,7 @@ class QueueItem:
|
|||
'title': self.title,
|
||||
'artist': self.artist,
|
||||
'cover': self.cover,
|
||||
'explicit': self.explicit,
|
||||
'size': self.size,
|
||||
'files': self.files,
|
||||
'downloaded': self.downloaded,
|
||||
|
@ -67,12 +70,12 @@ class QueueItem:
|
|||
return light
|
||||
|
||||
class QISingle(QueueItem):
|
||||
def __init__(self, id=None, bitrate=None, title=None, artist=None, cover=None, type=None, settings=None, single=None, queueItemDict=None):
|
||||
def __init__(self, id=None, bitrate=None, title=None, artist=None, cover=None, explicit=False, type=None, settings=None, single=None, queueItemDict=None):
|
||||
if queueItemDict:
|
||||
super().__init__(queueItemDict=queueItemDict)
|
||||
self.single = queueItemDict['single']
|
||||
else:
|
||||
super().__init__(id, bitrate, title, artist, cover, 1, type, settings)
|
||||
super().__init__(id, bitrate, title, artist, cover, explicit, 1, type, settings)
|
||||
self.single = single
|
||||
|
||||
def toDict(self):
|
||||
|
@ -81,12 +84,12 @@ class QISingle(QueueItem):
|
|||
return queueItem
|
||||
|
||||
class QICollection(QueueItem):
|
||||
def __init__(self, id=None, bitrate=None, title=None, artist=None, cover=None, size=None, type=None, settings=None, collection=None, queueItemDict=None):
|
||||
def __init__(self, id=None, bitrate=None, title=None, artist=None, cover=None, explicit=False, size=None, type=None, settings=None, collection=None, queueItemDict=None):
|
||||
if queueItemDict:
|
||||
super().__init__(queueItemDict=queueItemDict)
|
||||
self.collection = queueItemDict['collection']
|
||||
else:
|
||||
super().__init__(id, bitrate, title, artist, cover, size, type, settings)
|
||||
super().__init__(id, bitrate, title, artist, cover, explicit, size, type, settings)
|
||||
self.collection = collection
|
||||
|
||||
def toDict(self):
|
||||
|
@ -95,12 +98,12 @@ class QICollection(QueueItem):
|
|||
return queueItem
|
||||
|
||||
class QIConvertable(QICollection):
|
||||
def __init__(self, id=None, bitrate=None, title=None, artist=None, cover=None, size=None, type=None, settings=None, extra=None, queueItemDict=None):
|
||||
def __init__(self, id=None, bitrate=None, title=None, artist=None, cover=None, explicit=False, size=None, type=None, settings=None, extra=None, queueItemDict=None):
|
||||
if queueItemDict:
|
||||
super().__init__(queueItemDict=queueItemDict)
|
||||
self.extra = queueItemDict['_EXTRA']
|
||||
else:
|
||||
super().__init__(id, bitrate, title, artist, cover, size, type, settings, [])
|
||||
super().__init__(id, bitrate, title, artist, cover, explicit, size, type, settings, [])
|
||||
self.extra = extra
|
||||
|
||||
def toDict(self):
|
||||
|
|
|
@ -72,6 +72,7 @@ class QueueManager:
|
|||
title,
|
||||
trackAPI_gw['ART_NAME'],
|
||||
f"https://e-cdns-images.dzcdn.net/images/cover/{trackAPI_gw['ALB_PICTURE']}/75x75-000000-80-0-0.jpg",
|
||||
int(trackAPI_gw['EXPLICIT_LYRICS']) > 0,
|
||||
'track',
|
||||
settings,
|
||||
trackAPI_gw,
|
||||
|
@ -115,6 +116,7 @@ class QueueManager:
|
|||
albumAPI['title'],
|
||||
albumAPI['artist']['name'],
|
||||
cover,
|
||||
albumAPI_gw['EXPLICIT_ALBUM_CONTENT']['EXPLICIT_LYRICS_STATUS'] > 0,
|
||||
totalSize,
|
||||
'album',
|
||||
settings,
|
||||
|
@ -160,6 +162,7 @@ class QueueManager:
|
|||
playlistAPI['title'],
|
||||
playlistAPI['creator']['name'],
|
||||
playlistAPI['picture_small'][:-24] + '/75x75-000000-80-0-0.jpg',
|
||||
playlistAPI['explicit'],
|
||||
totalSize,
|
||||
'playlist',
|
||||
settings,
|
||||
|
@ -266,6 +269,7 @@ class QueueManager:
|
|||
playlistAPI['title'],
|
||||
playlistAPI['creator']['name'],
|
||||
playlistAPI['picture_small'][:-24] + '/75x75-000000-80-0-0.jpg',
|
||||
playlistAPI['explicit'],
|
||||
totalSize,
|
||||
'playlist',
|
||||
settings,
|
||||
|
|
|
@ -246,6 +246,7 @@ class SpotifyHelper:
|
|||
spotify_playlist['name'],
|
||||
spotify_playlist['owner']['display_name'],
|
||||
cover,
|
||||
playlistAPI['explicit'],
|
||||
totalSize,
|
||||
'spotify_playlist',
|
||||
settings,
|
||||
|
|
Loading…
Reference in a new issue