Fix bug in unique tracks on different albums

This commit is contained in:
2023-01-19 15:20:26 -05:00
parent 6712e38689
commit 0d95f8fee8
6 changed files with 63 additions and 20 deletions

View File

@ -103,7 +103,10 @@ class Track(ScrobblableMixin):
artist = models.ForeignKey(Artist, on_delete=models.DO_NOTHING)
album = models.ForeignKey(Album, on_delete=models.DO_NOTHING, **BNULL)
musicbrainz_id = models.CharField(max_length=255, unique=True, **BNULL)
musicbrainz_id = models.CharField(max_length=255, **BNULL)
class Meta:
unique_together = [['album', 'musicbrainz_id']]
def __str__(self):
return f"{self.title} by {self.artist}"