Skip to content

Commit 97410a0

Browse files
committed
Fix some minor issues/linter errors
1 parent fc3f0d1 commit 97410a0

File tree

5 files changed

+15
-17
lines changed

5 files changed

+15
-17
lines changed

twitch_indicator/api/api_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ async def _refresh_live_streams(self) -> None:
201201
# Ensure current profile pictures
202202
await self.api.fetch_profile_pictures(s.user_id for s in live_streams)
203203

204-
# Send live stream to GUI
204+
# Send live streams to GUI
205205
GLib.idle_add(self.app.state.set_live_streams, live_streams)
206206

207207
async def _refresh_followed_channels(self, user_id: int) -> None:

twitch_indicator/api/twitch_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ async def fetch_profile_pictures(self, all_user_ids: Iterable[int]) -> None:
108108
filename_icon = get_cached_image_filename(user_id, "icon")
109109
try:
110110
# check regular variant
111-
mtimestamp = datetime.utcfromtimestamp(await path.getmtime(filename))
111+
mtimestamp = datetime.fromtimestamp(await path.getmtime(filename))
112112
mtimestamp = mtimestamp.replace(tzinfo=timezone.utc)
113113
if now - mtimestamp > timedelta(days=3):
114114
user_ids.append(user_id)

twitch_indicator/gui/indicator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from gi.repository import GLib, Gtk, XApp
44

5-
from twitch_indicator.api.models import Stream, ValidationInfo
5+
from twitch_indicator.api.models import Stream
66
from twitch_indicator.gui.cached_profile_image import CachedProfileImage
77
from twitch_indicator.settings import Settings
88
from twitch_indicator.state import ChannelState

twitch_indicator/gui/notifications.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,18 @@ def _update_live_streams(self, new_streams: list[Stream]) -> None:
3737
# Skip first notification run
3838
with app.state.locks["first_run"]:
3939
first_run = app.state.first_run
40-
if not first_run:
41-
if app.settings.get_boolean("enable-notifications"):
42-
with app.state.locks["enabled_channel_ids"]:
43-
ec_ids = app.state.enabled_channel_ids
44-
notify_list = [
45-
deepcopy(s)
46-
for s in new_streams
47-
# stream wasn't live before?
48-
if s.user_id not in self._live_stream_user_ids
49-
# stream is in enabled list?
50-
and ec_ids.get(s.user_id, ChannelState.DISABLED) == ChannelState.ENABLED
51-
]
52-
GLib.idle_add(self._show_notifications, notify_list)
40+
if not first_run and app.settings.get_boolean("enable-notifications"):
41+
with app.state.locks["enabled_channel_ids"]:
42+
ec_ids = app.state.enabled_channel_ids
43+
notify_list = [
44+
deepcopy(s)
45+
for s in new_streams
46+
# stream wasn't live before?
47+
if s.user_id not in self._live_stream_user_ids
48+
# stream is in enabled list?
49+
and ec_ids.get(s.user_id, ChannelState.DISABLED) == ChannelState.ENABLED
50+
]
51+
GLib.idle_add(self._show_notifications, notify_list)
5352

5453
self._live_stream_user_ids = [s.user_id for s in new_streams]
5554

twitch_indicator/utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import asyncio
21
import os
32
import traceback
43
from concurrent.futures import CancelledError, Future

0 commit comments

Comments
 (0)