@@ -84,7 +84,7 @@ def __init__(self, ansi_code: str, plex_api: PlexAPI, tautulli_api: TautulliAPI,
84
84
plex_library_name : str = ''
85
85
plex_media_path : str = ''
86
86
if 'plex_library_name' in library and 'plex_media_path' in library :
87
- if plex_users_defined == True :
87
+ if plex_users_defined is True :
88
88
plex_library_name = library ['plex_library_name' ]
89
89
plex_media_path = library ['plex_media_path' ]
90
90
else :
@@ -93,7 +93,7 @@ def __init__(self, ansi_code: str, plex_api: PlexAPI, tautulli_api: TautulliAPI,
93
93
emby_library_name = ''
94
94
emby_media_path = ''
95
95
if 'emby_library_name' in library and 'emby_media_path' in library :
96
- if emby_users_defined == True :
96
+ if emby_users_defined is True :
97
97
emby_library_name = library ['emby_library_name' ]
98
98
emby_media_path = library ['emby_media_path' ]
99
99
else :
@@ -108,7 +108,7 @@ def __init__(self, ansi_code: str, plex_api: PlexAPI, tautulli_api: TautulliAPI,
108
108
self .log_error ('Read config {}' .format (utils .get_tag ('error' , e )))
109
109
110
110
def hours_since_play (self , use_utc_time : bool , play_date_time : datetime ) -> int :
111
- current_date_time = datetime .now (timezone .utc ) if use_utc_time == True else datetime .now ()
111
+ current_date_time = datetime .now (timezone .utc ) if use_utc_time is True else datetime .now ()
112
112
time_difference = current_date_time - play_date_time
113
113
return (time_difference .days * 24 ) + (time_difference .seconds / 3600 )
114
114
@@ -146,7 +146,7 @@ def __find_emby_watched_media(self, lib: LibraryInfo, user_list: List[UserInfo])
146
146
item_id = item ['EpisodeId' ]
147
147
else :
148
148
item_id = item ['NowPlayingItemId' ]
149
- if self .emby_api .get_watched_status (user .emby_user_id , item_id ) == True :
149
+ if self .emby_api .get_watched_status (user .emby_user_id , item_id ) is True :
150
150
item_hours_since_play = self .hours_since_play (True , datetime .fromisoformat (item ['ActivityDateInserted' ]))
151
151
if item_hours_since_play >= self .delete_time_hours :
152
152
emby_item = self .emby_api .search_item (item_id )
@@ -166,7 +166,7 @@ def __get_libraries(self) -> List[LibraryInfo]:
166
166
plex_library_name : str = ''
167
167
plex_library_id : str = ''
168
168
if library_config .plex_library_name != '' :
169
- if self .tautulli_api .get_valid () == True :
169
+ if self .tautulli_api .get_valid () is True :
170
170
library_id = self .tautulli_api .get_library_id (library_config .plex_library_name )
171
171
if library_id != self .tautulli_api .get_invalid_item ():
172
172
plex_library_name = library_config .plex_library_name
@@ -179,7 +179,7 @@ def __get_libraries(self) -> List[LibraryInfo]:
179
179
emby_library_name : str = ''
180
180
emby_library_id : str = ''
181
181
if library_config .emby_library_name != '' :
182
- if self .jellystat_api .get_valid () == True :
182
+ if self .jellystat_api .get_valid () is True :
183
183
library_id = self .jellystat_api .get_library_id (library_config .emby_library_name )
184
184
if library_id != self .jellystat_api .get_invalid_type ():
185
185
emby_library_name = library_config .emby_library_name
@@ -205,7 +205,7 @@ def __get_user_list(self) -> List[UserInfo]:
205
205
if user_config .plex_user_name != '' :
206
206
plex_api_valid = self .plex_api .get_valid ()
207
207
tautulli_api_valid = self .tautulli_api .get_valid ()
208
- if plex_api_valid == True and tautulli_api_valid == True :
208
+ if plex_api_valid is True and tautulli_api_valid is True :
209
209
plex_user_info = self .tautulli_api .get_user_info (user_config .plex_user_name )
210
210
if plex_user_info != self .tautulli_api .get_invalid_item ():
211
211
plex_user_name = user_config .plex_user_name
@@ -217,27 +217,27 @@ def __get_user_list(self) -> List[UserInfo]:
217
217
else :
218
218
self .log_warning ('{} could not find {}' .format (utils .get_formatted_tautulli (), utils .get_tag ('user' , user_config .plex_user_name )))
219
219
else :
220
- if plex_api_valid == False :
220
+ if plex_api_valid is False :
221
221
self .log_warning (self .plex_api .get_connection_error_log ())
222
- if tautulli_api_valid == False :
222
+ if tautulli_api_valid is False :
223
223
self .log_warning (self .tautulli_api .get_connection_error_log ())
224
224
225
225
emby_user_name = ''
226
226
emby_user_id = ''
227
227
if user_config .emby_user_name != '' :
228
228
emby_api_valid = self .emby_api .get_valid ()
229
229
jellystat_api_valid = self .jellystat_api .get_valid ()
230
- if emby_api_valid == True and jellystat_api_valid == True :
230
+ if emby_api_valid is True and jellystat_api_valid is True :
231
231
emby_user_id = self .emby_api .get_user_id (user_config .emby_user_name )
232
232
if emby_user_id != self .emby_api .get_invalid_item_id ():
233
233
emby_user_name = user_config .emby_user_name
234
234
else :
235
235
emby_user_id = ''
236
236
self .log_warning ('{} could not find {}' .format (utils .get_formatted_emby (), utils .get_tag ('user' , user_config .emby_user_name )))
237
237
else :
238
- if emby_api_valid == False :
238
+ if emby_api_valid is False :
239
239
self .log_warning (self .emby_api .get_connection_error_log ())
240
- if jellystat_api_valid == False :
240
+ if jellystat_api_valid is False :
241
241
self .log_warning (self .jellystat_api .get_connection_error_log ())
242
242
243
243
if plex_user_name != '' or emby_user_name != '' :
@@ -273,7 +273,7 @@ def __check_delete_media(self):
273
273
if notify_lib .id == media .library .id :
274
274
notify_lib_found = True
275
275
break
276
- if notify_lib_found == False :
276
+ if notify_lib_found is False :
277
277
libraries_to_notify .append (media .library )
278
278
except Exception as e :
279
279
self .log_error ('Failed to delete {} {}' .format (utils .get_tag ('file' , media .file_path ), utils .get_tag ('error' , e )))
0 commit comments