Skip to content

Commit

Permalink
Format files
Browse files Browse the repository at this point in the history
  • Loading branch information
rdbende committed Jul 14, 2024
1 parent 18f2c27 commit b563984
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
11 changes: 7 additions & 4 deletions cozy/ui/book_detail_view.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
import logging
import time
from math import pi as PI
from threading import Event, Thread
from typing import Callable, Final
from math import pi as PI

from gi.repository import Adw, GLib, Gtk, GObject, Gdk, Graphene, Gsk, Gio
import cairo
from gi.repository import Adw, Gio, GLib, GObject, Graphene, Gtk

from cozy.control.artwork_cache import ArtworkCache
from cozy.ext import inject
from cozy.model.book import Book
from cozy.model.chapter import Chapter
from cozy.report import reporter
from cozy.ui.chapter_element import ChapterElement
from cozy.view_model.book_detail_view_model import BookDetailViewModel
from cozy.ui.toaster import ToastNotifier
from cozy.view_model.book_detail_view_model import BookDetailViewModel

log = logging.getLogger(__name__)

Expand Down Expand Up @@ -303,7 +304,9 @@ def _display_external_section(self):

if external:
self.available_offline_action.handler_block_by_func(self._download_switch_changed)
self.available_offline_action.set_state(GLib.Variant.new_boolean(self._view_model.book.offline))
self.available_offline_action.set_state(
GLib.Variant.new_boolean(self._view_model.book.offline)
)
self.available_offline_action.handler_unblock_by_func(self._download_switch_changed)

def _set_cover_image(self, book: Book):
Expand Down
7 changes: 6 additions & 1 deletion cozy/view_model/book_detail_view_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,12 @@ def _on_playback_speed_changed(self):
self._notify("length")

def _on_offline_cache_event(self, event, message) -> None:
if self._book and isinstance(message, Book) and self._book.id == message.id and event in {"book-offline-removed", "book-offline"}:
if (
self._book
and isinstance(message, Book)
and self._book.id == message.id
and event in {"book-offline-removed", "book-offline"}
):
self._notify("downloaded")

def _on_app_setting_changed(self, event, _):
Expand Down

0 comments on commit b563984

Please sign in to comment.