Duration Fix, now recognizes hours and minutes

This commit is contained in:
Alhaziel
2019-04-11 20:23:53 +02:00
parent 69f451c332
commit 34beb82cd2

View File

@@ -166,6 +166,9 @@ def scrape(item, patron = '', listGroups = [], headers="", blacklist="", data=""
if scrapedplot:
infolabels['plot'] = plot
if scrapedduration:
matches = scrapertoolsV2.find_multiple_matches(scrapedduration, r'([0-9])\s*?(?:[hH]|:|\.|,|\\|\/|\||\s)\s*?([0-9]+)')
for h, m in matches:
scrapedduration = int(h) * 60 + int(m)
infolabels['duration'] = int(scrapedduration) * 60
if scrapedgenre:
genres = scrapertoolsV2.find_multiple_matches(scrapedgenre, '[A-Za-z]+')