Skip to content

Commit

Permalink
Allow watchdog execution for purging an unaccepted_file_extension and…
Browse files Browse the repository at this point in the history
… removed description limit on bookwalker_check
  • Loading branch information
zachstultz authored Mar 25, 2023
1 parent 7d308f2 commit bd6da85
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions komga_cover_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,10 +411,24 @@ def on_any_event(event):
and not os.path.basename(event.src_path).startswith(".")
and event.event_type == "created"
and os.path.isfile(event.src_path)
and get_file_extension(os.path.basename(event.src_path)) in file_extensions
and (
get_file_extension(os.path.basename(event.src_path)) in file_extensions
or (
delete_unacceptable_files_toggle
and get_file_extension(os.path.basename(event.src_path))
in unaccepted_file_extensions
)
)
):
time.sleep(sleep_timer)
if os.path.isfile(event.src_path) and zipfile.is_zipfile(event.src_path):
if os.path.isfile(event.src_path) and (
zipfile.is_zipfile(event.src_path)
or (
delete_unacceptable_files_toggle
and get_file_extension(os.path.basename(event.src_path))
in unaccepted_file_extensions
)
):
last_watchdog_file = event.src_path
send_message("Starting Script (WATCHDOG) (EXPERIMENTAL)", discord=False)
embed = [
Expand Down Expand Up @@ -7712,8 +7726,8 @@ def check_for_new_volumes_on_bookwalker():

# Add the description if it exists
if r.description:
if len(r.description) > 350:
r.description = r.description[:347] + "..."
# if len(r.description) > 350:
# r.description = r.description[:347] + "..."
embed[0].fields.append(
{
"name": "Description:",
Expand Down Expand Up @@ -7793,8 +7807,8 @@ def check_for_new_volumes_on_bookwalker():

# Add the description if it exists
if p.description:
if len(p.description) > 350:
p.description = p.description[:347] + "..."
# if len(p.description) > 350:
# p.description = p.description[:347] + "..."
embed[0].fields.append(
{
"name": "Description:",
Expand Down

0 comments on commit bd6da85

Please sign in to comment.