Skip to content

Commit

Permalink
Merge pull request #205 from luigi311/simplify_watched
Browse files Browse the repository at this point in the history
Simplify get watched process
  • Loading branch information
luigi311 authored Oct 28, 2024
2 parents 8428be9 + 62d0319 commit 86f7299
Show file tree
Hide file tree
Showing 14 changed files with 319 additions and 386 deletions.
24 changes: 22 additions & 2 deletions src/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,18 @@ def logger(message: str, log_type=0):


def log_marked(
username: str, library: str, movie_show: str, episode: str = None, duration=None
server_type: str,
server_name: str,
username: str,
library: str,
movie_show: str,
episode: str = None,
duration=None,
):
if mark_file is None:
return

output = f"{username}/{library}/{movie_show}"
output = f"{server_type}/{server_name}/{username}/{library}/{movie_show}"

if episode:
output += f"/{episode}"
Expand Down Expand Up @@ -93,6 +99,20 @@ def search_mapping(dictionary: dict, key_value: str):
return None


# Return list of objects that exist in both lists including mappings
def match_list(list1, list2, list_mapping=None):
output = []
for element in list1:
if element in list2:
output.append(element)
elif list_mapping:
element_other = search_mapping(list_mapping, element)
if element_other in list2:
output.append(element)

return output


def future_thread_executor(
args: list, threads: int = None, override_threads: bool = False
):
Expand Down
Loading

0 comments on commit 86f7299

Please sign in to comment.