mirror of
https://github.com/rembo10/headphones.git
synced 2026-07-21 08:24:00 +01:00
fixed multiple download links being sent to SAB
This commit is contained in:
+1
-1
@@ -38,10 +38,10 @@ def itunesImport(pathtoxml):
|
|||||||
else:
|
else:
|
||||||
c.execute('INSERT INTO artists VALUES( ?, ?, ?, CURRENT_DATE, ?)', (artistid, artist.name, artist.sortName, 'Active'))
|
c.execute('INSERT INTO artists VALUES( ?, ?, ?, CURRENT_DATE, ?)', (artistid, artist.name, artist.sortName, 'Active'))
|
||||||
for release in artist.getReleases():
|
for release in artist.getReleases():
|
||||||
|
time.sleep(1)
|
||||||
releaseid = u.extractUuid(release.id)
|
releaseid = u.extractUuid(release.id)
|
||||||
inc = ws.ReleaseIncludes(artist=True, releaseEvents= True, tracks= True, releaseGroup=True)
|
inc = ws.ReleaseIncludes(artist=True, releaseEvents= True, tracks= True, releaseGroup=True)
|
||||||
results = ws.Query().getReleaseById(releaseid, inc)
|
results = ws.Query().getReleaseById(releaseid, inc)
|
||||||
time.sleep(1)
|
|
||||||
for event in results.releaseEvents:
|
for event in results.releaseEvents:
|
||||||
if event.country == 'US':
|
if event.country == 'US':
|
||||||
c.execute('INSERT INTO albums VALUES( ?, ?, ?, ?, ?, CURRENT_DATE, ?, ?)', (artistid, results.artist.name, results.title, results.asin, results.getEarliestReleaseDate(), u.extractUuid(results.id), 'Skipped'))
|
c.execute('INSERT INTO albums VALUES( ?, ?, ?, ?, ?, CURRENT_DATE, ?, ?)', (artistid, results.artist.name, results.title, results.asin, results.getEarliestReleaseDate(), u.extractUuid(results.id), 'Skipped'))
|
||||||
|
|||||||
@@ -77,6 +77,7 @@ def searchNZB(albumid=None):
|
|||||||
except:
|
except:
|
||||||
print '''No results found'''
|
print '''No results found'''
|
||||||
|
|
||||||
|
if len(resultlist):
|
||||||
bestqual = sorted(resultlist, key=lambda title: title[1], reverse=True)[0]
|
bestqual = sorted(resultlist, key=lambda title: title[1], reverse=True)[0]
|
||||||
|
|
||||||
downloadurl = bestqual[2]
|
downloadurl = bestqual[2]
|
||||||
@@ -96,5 +97,8 @@ def searchNZB(albumid=None):
|
|||||||
c.execute('UPDATE albums SET status = "Snatched" WHERE AlbumID="%s"' % albums[2])
|
c.execute('UPDATE albums SET status = "Snatched" WHERE AlbumID="%s"' % albums[2])
|
||||||
conn.commit()
|
conn.commit()
|
||||||
|
|
||||||
|
else:
|
||||||
|
pass
|
||||||
|
|
||||||
c.close()
|
c.close()
|
||||||
|
|
||||||
+2
-2
@@ -36,6 +36,6 @@ class threadtool(SimplePlugin):
|
|||||||
import mover
|
import mover
|
||||||
from webServer import database
|
from webServer import database
|
||||||
if os.path.exists(database):
|
if os.path.exists(database):
|
||||||
self.sched.add_cron_job(updater.dbUpdate, hour=3)
|
self.sched.add_cron_job(updater.dbUpdate, hour=4, minute=0, second=0)
|
||||||
self.sched.add_interval_job(searcher.searchNZB, hours=18)
|
self.sched.add_interval_job(searcher.searchNZB, hours=12)
|
||||||
#self.sched.add_interval_job(mover.moveFiles, minutes=10)
|
#self.sched.add_interval_job(mover.moveFiles, minutes=10)
|
||||||
|
|||||||
Reference in New Issue
Block a user