Переглянути джерело

[music] Fixes RYM slug including commas

Colin Powell 2 місяців тому
батько
коміт
141700fcb3
2 змінених файлів з 14 додано та 8 видалено
  1. 13 7
      todos.org
  2. 1 1
      vrobbler/apps/music/models.py

+ 13 - 7
todos.org

@@ -1,6 +1,6 @@
 #+title: TODOs
 
-* Backlog [0/7]
+* Backlog [5/11]
 ** TODO [#B] Add AllTrails as a source for Trail data :vrobbler:trails:feature:personal:project:
 Pretty clear, I would love to make trails more useful. Historically I wasn't
 hiking a lot, which made the source for this a bit silly. But it's clear that
@@ -10,11 +10,6 @@ Would be nice to have some loose connection to the actual event in my Garmin pro
 ** TODO [#B] Explore a way to add metadata editing to scrobbles after saving :vrobbler:spike:scrobbling:personal:project:
 Could be as simple as a JSON form on the scrobble detail page (do I have have one of those yet?).
 ** TODO [#B] Explore a good way to show notes and descriptions from scrobbles to users :personal:project:scrobbling:vrobbler:spike:
-** TODO [#C] Replace commas in the bandcamp URL for artists with nothing :vrobbler:music:bug:personal:
-:PROPERTIES:
-:ID:       9b30d67b-91f0-a480-dfaa-5d9dc090e76c
-:END:
-
 ** TODO [#C] Fix bug where podcast scrobbling creates duplicate Podcast :project:vrobbler:scrobbling:podcasts:bug:personal:
 Rather than pick up an existing Podcast using the podcast title in the mopidy
 file name, Vrobbler creates a new podcast with no enriched data. Not a big deal
@@ -311,7 +306,18 @@ it's annoying.
     }
 }
 #+end_src
-* Version 17 [4/4]
+** DONE [#C] Replace commas in the bandcamp URL for artists with nothing :vrobbler:music:bug:personal:
+:PROPERTIES:
+:ID:       9b30d67b-91f0-a480-dfaa-5d9dc090e76c
+:END:
+
+- Note taken on [2025-06-16 Mon 09:36]
+
+  This firt appeared with Black Country, New Road, where the RYM slug generator
+  leaves commas in and ends up sending you to a 404. I suspect this wont be the
+  first tweak we'll need to this, as the RYM link creator is really just
+  guessing based on the artist name at the path.
+
 ** DONE [#A] Investigate new source of video metadata :personal:project:video:imdb:
 :PROPERTIES:
 :ID:       df2b486c-1170-5199-c312-9bc87760d962

+ 1 - 1
vrobbler/apps/music/models.py

@@ -161,7 +161,7 @@ class Artist(TimeStampedModel):
 
     @property
     def rym_link(self):
-        artist_slug = self.name.lower().replace(" ", "-")
+        artist_slug = self.name.lower().replace(" ", "-").replace(",", "")
         return f"https://rateyourmusic.com/artist/{artist_slug}/"
 
     @property