Add icons for music services
This commit is contained in:
@ -77,6 +77,16 @@ class Artist(TimeStampedModel):
|
|||||||
img_filename = f"{self.name}_{self.uuid}.jpg"
|
img_filename = f"{self.name}_{self.uuid}.jpg"
|
||||||
self.thumbnail.save(img_filename, File(img_temp))
|
self.thumbnail.save(img_filename, File(img_temp))
|
||||||
|
|
||||||
|
@property
|
||||||
|
def rym_link(self):
|
||||||
|
artist_slug = self.name.lower().replace(' ', '-')
|
||||||
|
return f"https://rateyourmusic.com/artist/{artist_slug}/"
|
||||||
|
|
||||||
|
@property
|
||||||
|
def bandcamp_search_link(self):
|
||||||
|
artist = self.name.lower()
|
||||||
|
return f"https://bandcamp.com/search?q={artist}&item_type=b"
|
||||||
|
|
||||||
|
|
||||||
class Album(TimeStampedModel):
|
class Album(TimeStampedModel):
|
||||||
uuid = models.UUIDField(default=uuid4, editable=False, **BNULL)
|
uuid = models.UUIDField(default=uuid4, editable=False, **BNULL)
|
||||||
@ -246,6 +256,18 @@ class Album(TimeStampedModel):
|
|||||||
return f"https://www.theaudiodb.com/album/{self.theaudiodb_id}"
|
return f"https://www.theaudiodb.com/album/{self.theaudiodb_id}"
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
@property
|
||||||
|
def rym_link(self):
|
||||||
|
artist_slug = self.primary_artist.name.lower().replace(' ', '-')
|
||||||
|
album_slug = self.name.lower().replace(' ', '-')
|
||||||
|
return f"https://rateyourmusic.com/release/album/{artist_slug}/{album_slug}/"
|
||||||
|
|
||||||
|
@property
|
||||||
|
def bandcamp_search_link(self):
|
||||||
|
artist = self.primary_artist.name.lower()
|
||||||
|
album = self.name.lower()
|
||||||
|
return f"https://bandcamp.com/search?q={album} {artist}&item_type=a"
|
||||||
|
|
||||||
|
|
||||||
class Track(ScrobblableMixin):
|
class Track(ScrobblableMixin):
|
||||||
COMPLETION_PERCENT = getattr(settings, 'MUSIC_COMPLETION_PERCENT', 90)
|
COMPLETION_PERCENT = getattr(settings, 'MUSIC_COMPLETION_PERCENT', 90)
|
||||||
|
|||||||
BIN
vrobbler/apps/scrobbles/static/images/allmusic-logo.png
Normal file
BIN
vrobbler/apps/scrobbles/static/images/allmusic-logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 90 KiB |
BIN
vrobbler/apps/scrobbles/static/images/bandcamp-logo.png
Normal file
BIN
vrobbler/apps/scrobbles/static/images/bandcamp-logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
BIN
vrobbler/apps/scrobbles/static/images/musicbrainz-logo.png
Normal file
BIN
vrobbler/apps/scrobbles/static/images/musicbrainz-logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 107 KiB |
BIN
vrobbler/apps/scrobbles/static/images/rateyourmusic-logo.jpg
Normal file
BIN
vrobbler/apps/scrobbles/static/images/rateyourmusic-logo.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 34 KiB |
BIN
vrobbler/apps/scrobbles/static/images/theaudiodb-logo.png
Normal file
BIN
vrobbler/apps/scrobbles/static/images/theaudiodb-logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 46 KiB |
@ -1,5 +1,6 @@
|
|||||||
{% extends "base_list.html" %}
|
{% extends "base_list.html" %}
|
||||||
{% load mathfilters %}
|
{% load mathfilters %}
|
||||||
|
{% load static %}
|
||||||
|
|
||||||
{% block title %}{{object.name}}{% endblock %}
|
{% block title %}{{object.name}}{% endblock %}
|
||||||
|
|
||||||
@ -17,7 +18,13 @@
|
|||||||
<p>{{object.theaudiodb_description|safe|linebreaks|truncatewords:160}}</p>
|
<p>{{object.theaudiodb_description|safe|linebreaks|truncatewords:160}}</p>
|
||||||
<hr/>
|
<hr/>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<p><a href="{{album.mb_link}}">Musicbrainz</a> {% if album.tadb_link %}| <a href="{{album.tadb_link}}">TheAudioDB</a>{% endif %} {% if album.allmusic_link %}| <a href="{{album.allmusic_link}}">AllMusic</a>{% endif %}</p>
|
<p style="float:right;">
|
||||||
|
<a href="{{album.mb_link}}"><img src="{% static "images/musicbrainz-logo.png" %}" width=35></a>
|
||||||
|
<a href="{{album.rym_link}}"><img src="{% static "images/rateyourmusic-logo.jpg" %}" width=35></a>
|
||||||
|
<a href="{{album.bandcamp_search_link}}"><img src="{% static "images/bandcamp-logo.png" %}" width=35></a>
|
||||||
|
{% if album.tadb_link %}<a href="{{album.tadb_link}}"><img src="{% static "images/theaudiodb-logo.png" %}" width=35></a>{% endif %}
|
||||||
|
{% if album.allmusic_link %}<a href="{{album.allmusic_link}}"><img src="{% static "images/allmusic-logo.png" %}" width=35></a>{% endif %}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
{% extends "base_list.html" %}
|
{% extends "base_list.html" %}
|
||||||
{% load mathfilters %}
|
{% load mathfilters %}
|
||||||
|
{% load static %}
|
||||||
|
|
||||||
{% block title %}{{object.name}}{% endblock %}
|
{% block title %}{{object.name}}{% endblock %}
|
||||||
|
|
||||||
@ -22,7 +23,11 @@
|
|||||||
<p>{{artist.biography|safe|linebreaks|truncatewords:160}}</p>
|
<p>{{artist.biography|safe|linebreaks|truncatewords:160}}</p>
|
||||||
<hr/>
|
<hr/>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<p><a href="{{artist.mb_link}}">Musicbrainz</a></p>
|
<p style="float:right;">
|
||||||
|
<a href="{{artist.mb_link}}"><img src="{% static "images/musicbrainz-logo.png" %}" width=35></a>
|
||||||
|
<a href="{{artist.rym_link}}"><img src="{% static "images/rateyourmusic-logo.jpg" %}" width=35></a>
|
||||||
|
<a href="{{artist.bandcamp_search_link}}"><img src="{% static "images/bandcamp-logo.png" %}" width=35></a>
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|||||||
Reference in New Issue
Block a user