You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 2, 2021. It is now read-only.
When importing a folder containing a cvinfo file the following appeared in the log: ERROR :: mylar.scanLibrary.620 : LibraryScan : [IMPORT] Unable to complete the scan: list index out of range
I traced it through to libraryScan in librarysync.py, around line 254:
try:
with open(os.path.join(os.path.dirname(comlocation), 'cvinfo')) as f:
urllink = f.readline()
if urllink:
cid = urllink.split('/')
if '4050-' in cid[-2]:
cvinfo_CID = re.sub('4050-', '', cid[-2]).strip()
logger.info('CVINFO file located within directory. Attaching everything in directory that is valid to ComicID: ' + str(cvinfo_CID))
#store the location of the cvinfo so it's applied to the correct directory (since we're scanning multile direcorties usually)
cvscanned_loc = os.path.dirname(comlocation)
else:
logger.error("Could not read cvinfo file properly (or it does not contain any data)")
except (OSError, IOError):
logger.error("Could not read cvinfo file properly (or it does not contain any data)")
You can see it splits the urllink by the '/' character. However, a cvinfo file as described in Comicvine Scraper doesn't require the full url. Just the 4050-xxxxx part. So when it isn't able to create a list long enough to look for cid[-2], the index out of range error occurs. Seems like it would be reasonable to do a regex to look for the digits following the 4050- portion, and that would take care of any format a person might use.
While filing this, I did a fork and a fix. I'll commit the change and make a pull request.
The text was updated successfully, but these errors were encountered:
boshuda
added a commit
to boshuda/mylar
that referenced
this issue
Apr 18, 2018
If the cvinfo had information in an unsupported format, like just 4050-xxxxx then the regular expression sub would cause an end of index exception.
Now the regex just looks for 4050-xxxxx, and doesn't really care about the format.
evilhero#1923
If the cvinfo had information in an unsupported format, like just 4050-xxxxx then the regular expression sub would cause an end of index exception.
Now the regex just looks for 4050-xxxxx, and doesn't really care about the format.
#1923
When importing a folder containing a cvinfo file the following appeared in the log: ERROR :: mylar.scanLibrary.620 : LibraryScan : [IMPORT] Unable to complete the scan: list index out of range
I traced it through to libraryScan in librarysync.py, around line 254:
You can see it splits the urllink by the '/' character. However, a cvinfo file as described in Comicvine Scraper doesn't require the full url. Just the 4050-xxxxx part. So when it isn't able to create a list long enough to look for cid[-2], the index out of range error occurs. Seems like it would be reasonable to do a regex to look for the digits following the 4050- portion, and that would take care of any format a person might use.
While filing this, I did a fork and a fix. I'll commit the change and make a pull request.
The text was updated successfully, but these errors were encountered: