No error when trailers aren't found. fix #327

This commit is contained in:
Ruud
2012-05-22 23:12:24 +02:00
parent a1ac73a9a1
commit 75b734db72
+4 -1
View File
@@ -1,5 +1,5 @@
from couchpotato.core.event import addEvent, fireEvent
from couchpotato.core.helpers.variable import getExt
from couchpotato.core.helpers.variable import getExt, getTitle
from couchpotato.core.logger import CPLog
from couchpotato.core.plugins.base import Plugin
import os
@@ -17,6 +17,9 @@ class Trailer(Plugin):
if self.isDisabled() or len(group['files']['trailer']) > 0: return
trailers = fireEvent('trailer.search', group = group, merge = True)
if not trailers or trailers == []:
log.info('No trailers found for: %s' % getTitle(group['library']))
return
for trailer in trailers.get(self.conf('quality'), []):
destination = '%s-trailer.%s' % (self.getRootName(group), getExt(trailer))