Show a default cover art when coverArt
not present in views
This commit is contained in:
1
setup.py
1
setup.py
@@ -47,6 +47,7 @@ setup(
|
||||
'sublime': [
|
||||
'ui/app_styles.css',
|
||||
'ui/images/play-queue-play.png',
|
||||
'ui/images/default-album-art.png',
|
||||
'ui/mpris_specs/org.mpris.MediaPlayer2.xml',
|
||||
'ui/mpris_specs/org.mpris.MediaPlayer2.Player.xml',
|
||||
'ui/mpris_specs/org.mpris.MediaPlayer2.Playlists.xml',
|
||||
|
@@ -876,6 +876,11 @@ class CacheManager(metaclass=Singleton):
|
||||
force: bool = False,
|
||||
allow_download: bool = True,
|
||||
) -> 'CacheManager.Result[Optional[str]]':
|
||||
if id is None:
|
||||
art_path = 'ui/images/default-album-art.png'
|
||||
return CacheManager.Result.from_data(str(
|
||||
Path(__file__).joinpath(art_path)
|
||||
))
|
||||
return self.return_cached_or_download(
|
||||
f'cover_art/{id}_{size}',
|
||||
lambda: self.server.get_cover_art(id, str(size)),
|
||||
|
BIN
sublime/ui/images/default-album-art.png
Normal file
BIN
sublime/ui/images/default-album-art.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.8 KiB |
99
sublime/ui/images/default-album-art.svg
Normal file
99
sublime/ui/images/default-album-art.svg
Normal file
@@ -0,0 +1,99 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
fill="#000000"
|
||||
viewBox="0 0 24 24"
|
||||
width="384px"
|
||||
height="384px"
|
||||
version="1.1"
|
||||
id="svg6"
|
||||
sodipodi:docname="icons8-music.svg"
|
||||
inkscape:version="0.92.4 5da689c313, 2019-01-14">
|
||||
<metadata
|
||||
id="metadata12">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs10" />
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1366"
|
||||
inkscape:window-height="729"
|
||||
id="namedview8"
|
||||
showgrid="false"
|
||||
inkscape:zoom="0.61458333"
|
||||
inkscape:cx="192"
|
||||
inkscape:cy="192"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg6">
|
||||
<sodipodi:guide
|
||||
position="0,0"
|
||||
orientation="0,384"
|
||||
id="guide14"
|
||||
inkscape:locked="false" />
|
||||
<sodipodi:guide
|
||||
position="24,0"
|
||||
orientation="-384,0"
|
||||
id="guide16"
|
||||
inkscape:locked="false" />
|
||||
<sodipodi:guide
|
||||
position="24,24"
|
||||
orientation="0,-384"
|
||||
id="guide18"
|
||||
inkscape:locked="false" />
|
||||
<sodipodi:guide
|
||||
position="0,24"
|
||||
orientation="384,0"
|
||||
id="guide20"
|
||||
inkscape:locked="false" />
|
||||
</sodipodi:namedview>
|
||||
<rect
|
||||
id="rect22"
|
||||
width="24"
|
||||
height="24"
|
||||
x="0"
|
||||
y="0"
|
||||
style="stroke-width:0.0625;fill:#e6e6e6" />
|
||||
<g
|
||||
id="g26"
|
||||
style="stroke:#b3b3b3">
|
||||
<path
|
||||
id="path2"
|
||||
d="M9 15A3 3 0 1 0 9 21A3 3 0 1 0 9 15Z"
|
||||
stroke-width="2"
|
||||
stroke-miterlimit="10"
|
||||
stroke="#000000"
|
||||
fill="none"
|
||||
style="stroke:#b3b3b3" />
|
||||
<path
|
||||
id="path4"
|
||||
d="M12 18L12 4 18 4 18 8 13 8"
|
||||
stroke-width="2"
|
||||
stroke-miterlimit="10"
|
||||
stroke="#000000"
|
||||
fill="none"
|
||||
style="stroke:#b3b3b3" />
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.5 KiB |
Reference in New Issue
Block a user