mirror of
https://github.com/evilhero/mylar
synced 2025-03-11 14:33:13 +00:00
FIX:(#617)(#618) list index out of range error due to CV changing search constaints and dropping legacy id support, IMP: Pull-list will now display Snatched issues
This commit is contained in:
parent
d146e0f0db
commit
7831984096
3 changed files with 7 additions and 6 deletions
mylar
|
@ -31,7 +31,7 @@ def pulldetails(comicid,type,issueid=None,offset=1):
|
||||||
|
|
||||||
comicapi='583939a3df0a25fc4e8b7a29934a13078002dc27'
|
comicapi='583939a3df0a25fc4e8b7a29934a13078002dc27'
|
||||||
if type == 'comic':
|
if type == 'comic':
|
||||||
PULLURL= mylar.CVURL + 'volume/' + str(comicid) + '/?api_key=' + str(comicapi) + '&format=xml&field_list=name,count_of_issues,issues,start_year,site_detail_url,image,publisher,description,first_issue'
|
PULLURL= mylar.CVURL + 'volume/4050-' + str(comicid) + '/?api_key=' + str(comicapi) + '&format=xml&field_list=name,count_of_issues,issues,start_year,site_detail_url,image,publisher,description,first_issue'
|
||||||
elif type == 'issue':
|
elif type == 'issue':
|
||||||
if mylar.CV_ONLY:
|
if mylar.CV_ONLY:
|
||||||
cv_type = 'issues'
|
cv_type = 'issues'
|
||||||
|
|
|
@ -17,7 +17,7 @@ from __future__ import with_statement
|
||||||
|
|
||||||
import time
|
import time
|
||||||
import threading
|
import threading
|
||||||
import urllib2
|
import urllib, urllib2
|
||||||
from xml.dom.minidom import parseString, Element
|
from xml.dom.minidom import parseString, Element
|
||||||
|
|
||||||
import mylar
|
import mylar
|
||||||
|
@ -28,14 +28,14 @@ mb_lock = threading.Lock()
|
||||||
|
|
||||||
|
|
||||||
def pullsearch(comicapi,comicquery,offset):
|
def pullsearch(comicapi,comicquery,offset):
|
||||||
u_comicquery = comicquery.encode('utf-8').strip()
|
u_comicquery = urllib.quote(comicquery.encode('utf-8').strip())
|
||||||
PULLURL = mylar.CVURL + 'search?api_key=' + str(comicapi) + '&resources=volume&query=' + u_comicquery + '&field_list=id,name,start_year,site_detail_url,count_of_issues,image,publisher,description&format=xml&page=' + str(offset)
|
PULLURL = mylar.CVURL + 'search?api_key=' + str(comicapi) + '&resources=volume&query=' + u_comicquery + '&field_list=id,name,start_year,site_detail_url,count_of_issues,image,publisher,description&format=xml&page=' + str(offset)
|
||||||
|
|
||||||
#all these imports are standard on most modern python implementations
|
#all these imports are standard on most modern python implementations
|
||||||
#download the file:
|
#download the file:
|
||||||
try:
|
try:
|
||||||
file = urllib2.urlopen(PULLURL)
|
file = urllib2.urlopen(PULLURL)
|
||||||
except urllib2.HTTPError, err:
|
except urllib2.HTTPError, err:
|
||||||
|
logger.error('err : ' + str(err))
|
||||||
logger.error("There was a major problem retrieving data from ComicVine - on their end. You'll have to try again later most likely.")
|
logger.error("There was a major problem retrieving data from ComicVine - on their end. You'll have to try again later most likely.")
|
||||||
return
|
return
|
||||||
#convert to string:
|
#convert to string:
|
||||||
|
@ -59,7 +59,8 @@ def findComic(name, mode, issue, limityear=None):
|
||||||
#print ("limityear: " + str(limityear))
|
#print ("limityear: " + str(limityear))
|
||||||
if limityear is None: limityear = 'None'
|
if limityear is None: limityear = 'None'
|
||||||
|
|
||||||
comicquery=name.replace(" ", "%20")
|
#comicquery=name.replace(" ", "%20")
|
||||||
|
comicquery=name.replace(" ", " AND ")
|
||||||
comicapi='583939a3df0a25fc4e8b7a29934a13078002dc27'
|
comicapi='583939a3df0a25fc4e8b7a29934a13078002dc27'
|
||||||
offset = 1
|
offset = 1
|
||||||
|
|
||||||
|
|
|
@ -263,7 +263,7 @@ def upcoming_update(ComicID, ComicName, IssueNumber, IssueDate, forcecheck=None,
|
||||||
else:
|
else:
|
||||||
myDB.upsert("issues", values, control)
|
myDB.upsert("issues", values, control)
|
||||||
|
|
||||||
if issuechk['Status'] == 'Downloaded' or issuechk['Status'] == 'Archived':
|
if issuechk['Status'] == 'Downloaded' or issuechk['Status'] == 'Archived' or issuechk['Status'] == 'Snatched':
|
||||||
logger.fdebug('updating Pull-list to reflect status.')
|
logger.fdebug('updating Pull-list to reflect status.')
|
||||||
downstats = {"Status": issuechk['Status'],
|
downstats = {"Status": issuechk['Status'],
|
||||||
"ComicID": issuechk['ComicID']}
|
"ComicID": issuechk['ComicID']}
|
||||||
|
|
Loading…
Add table
Reference in a new issue