diff --git a/vrobbler/apps/music/models.py b/vrobbler/apps/music/models.py index 2deaa08..1726889 100644 --- a/vrobbler/apps/music/models.py +++ b/vrobbler/apps/music/models.py @@ -77,6 +77,16 @@ class Artist(TimeStampedModel): img_filename = f"{self.name}_{self.uuid}.jpg" 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): 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 "" + @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): COMPLETION_PERCENT = getattr(settings, 'MUSIC_COMPLETION_PERCENT', 90) diff --git a/vrobbler/apps/scrobbles/static/images/allmusic-logo.png b/vrobbler/apps/scrobbles/static/images/allmusic-logo.png new file mode 100644 index 0000000..6fcb458 Binary files /dev/null and b/vrobbler/apps/scrobbles/static/images/allmusic-logo.png differ diff --git a/vrobbler/apps/scrobbles/static/images/bandcamp-logo.png b/vrobbler/apps/scrobbles/static/images/bandcamp-logo.png new file mode 100644 index 0000000..df5b5af Binary files /dev/null and b/vrobbler/apps/scrobbles/static/images/bandcamp-logo.png differ diff --git a/vrobbler/apps/scrobbles/static/images/musicbrainz-logo.png b/vrobbler/apps/scrobbles/static/images/musicbrainz-logo.png new file mode 100644 index 0000000..a4e9d17 Binary files /dev/null and b/vrobbler/apps/scrobbles/static/images/musicbrainz-logo.png differ diff --git a/vrobbler/apps/scrobbles/static/images/rateyourmusic-logo.jpg b/vrobbler/apps/scrobbles/static/images/rateyourmusic-logo.jpg new file mode 100644 index 0000000..a017609 Binary files /dev/null and b/vrobbler/apps/scrobbles/static/images/rateyourmusic-logo.jpg differ diff --git a/vrobbler/apps/scrobbles/static/images/theaudiodb-logo.png b/vrobbler/apps/scrobbles/static/images/theaudiodb-logo.png new file mode 100644 index 0000000..0460de8 Binary files /dev/null and b/vrobbler/apps/scrobbles/static/images/theaudiodb-logo.png differ diff --git a/vrobbler/templates/music/album_detail.html b/vrobbler/templates/music/album_detail.html index 259439e..0a5d1fd 100644 --- a/vrobbler/templates/music/album_detail.html +++ b/vrobbler/templates/music/album_detail.html @@ -1,5 +1,6 @@ {% extends "base_list.html" %} {% load mathfilters %} +{% load static %} {% block title %}{{object.name}}{% endblock %} @@ -17,7 +18,13 @@
{{object.theaudiodb_description|safe|linebreaks|truncatewords:160}}
Musicbrainz {% if album.tadb_link %}| TheAudioDB{% endif %} {% if album.allmusic_link %}| AllMusic{% endif %}
+
+
+
+
+ {% if album.tadb_link %}
{% endif %}
+ {% if album.allmusic_link %}
{% endif %}
+
{{artist.biography|safe|linebreaks|truncatewords:160}}