dont save oxdbid if not using imdb, 2 items might have the same id

This commit is contained in:
j 2012-06-26 10:48:43 +02:00
parent 5d87258eb8
commit 3fca65e86b

View file

@ -316,8 +316,7 @@ class Item(models.Model):
#this does not work if another item without imdbid has the same metadata #this does not work if another item without imdbid has the same metadata
oxdbId = self.oxdb_id() oxdbId = self.oxdb_id()
if not settings.USE_IMDB: if not settings.USE_IMDB:
update_poster = self.oxdbId != oxdbId self.oxdbId = None
self.oxdbId = oxdbId
elif oxdbId: elif oxdbId:
if self.oxdbId != oxdbId: if self.oxdbId != oxdbId:
q = Item.objects.filter(oxdbId=oxdbId).exclude(id=self.id) q = Item.objects.filter(oxdbId=oxdbId).exclude(id=self.id)