Compare commits
2 commits
19-multipl
...
master
Author | SHA1 | Date | |
---|---|---|---|
dfc59e94f9 | |||
3e609581cf |
2 changed files with 11 additions and 6 deletions
|
@ -142,16 +142,21 @@ def get_audio_from_item(item):
|
||||||
|
|
||||||
def get_urls(tree):
|
def get_urls(tree):
|
||||||
items = tree.xpath("//item")
|
items = tree.xpath("//item")
|
||||||
for it in items:
|
for i, it in enumerate(items):
|
||||||
# title = it.find("title").text
|
try:
|
||||||
audio = get_audio_from_item(it)
|
audio = get_audio_from_item(it)
|
||||||
|
except Exception:
|
||||||
|
logging.error("Could not parse item #%d, skipping", i)
|
||||||
|
continue
|
||||||
if audio is None:
|
if audio is None:
|
||||||
continue
|
continue
|
||||||
if audio.date is None:
|
if audio.date is None:
|
||||||
audio.date = get_item_date(it)
|
try:
|
||||||
|
audio.date = get_item_date(it)
|
||||||
|
except Exception:
|
||||||
|
logging.warn("Could not find date for item #%d", i)
|
||||||
yield audio
|
yield audio
|
||||||
|
|
||||||
|
|
||||||
def parse_duration(arg):
|
def parse_duration(arg):
|
||||||
if arg.isdecimal():
|
if arg.isdecimal():
|
||||||
secs = int(arg)
|
secs = int(arg)
|
||||||
|
|
|
@ -68,7 +68,7 @@ def percentwait(songs, context, conf, getdur=get_duration):
|
||||||
# must be an error! mutagen support is not always perfect
|
# must be an error! mutagen support is not always perfect
|
||||||
return (
|
return (
|
||||||
True,
|
True,
|
||||||
("mutagen could not calculate length of %s" % ",".songs["uris"]),
|
("mutagen could not calculate length of %s" % ",".join(songs["uris"])),
|
||||||
)
|
)
|
||||||
wait = eventduration * (percentwait / 100.0)
|
wait = eventduration * (percentwait / 100.0)
|
||||||
if remaining > wait:
|
if remaining > wait:
|
||||||
|
|
Loading…
Reference in a new issue