mirror of
https://github.com/nathom/streamrip.git
synced 2025-05-18 17:25:22 -04:00
Misc bug fixes
Signed-off-by: nathom <nathanthomas707@gmail.com>
This commit is contained in:
parent
e77182ae6a
commit
835c8d4cc6
5 changed files with 44 additions and 16 deletions
15
rip/core.py
15
rip/core.py
|
@ -230,16 +230,19 @@ class MusicDL(list):
|
|||
"max_artwork_height": int(artwork["max_height"]),
|
||||
}
|
||||
|
||||
def repair(self, max_items=float("inf")):
|
||||
print(list(self.failed_db))
|
||||
def repair(self, max_items=None):
|
||||
if max_items is None:
|
||||
max_items = float("inf")
|
||||
|
||||
if self.failed_db.is_dummy:
|
||||
click.secho(
|
||||
"Failed downloads database must be enabled to repair!", fg="red"
|
||||
"Failed downloads database must be enabled in the config file "
|
||||
"to repair!",
|
||||
fg="red",
|
||||
)
|
||||
exit(1)
|
||||
raise click.Abort
|
||||
|
||||
for counter, (source, media_type, item_id) in enumerate(self.failed_db):
|
||||
# print(f"handling item {source = } {media_type = } {item_id = }")
|
||||
if counter >= max_items:
|
||||
break
|
||||
|
||||
|
@ -293,13 +296,11 @@ class MusicDL(list):
|
|||
try:
|
||||
item.download(**arguments)
|
||||
except NonStreamable as e:
|
||||
print("caught in core")
|
||||
e.print(item)
|
||||
self.failed_db.add((item.client.source, item.type, item.id))
|
||||
continue
|
||||
except PartialFailure as e:
|
||||
for failed_item in e.failed_items:
|
||||
print(f"adding {failed_item} to database")
|
||||
self.failed_db.add(failed_item)
|
||||
continue
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue