From 25049590ce0298bccd57d8ec4a757d2b72d473ea Mon Sep 17 00:00:00 2001 From: Lars Noack Date: Tue, 9 Apr 2024 12:56:28 +0200 Subject: [PATCH] feat: renived redundand functions --- music_kraken/utils/object_handeling.py | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 music_kraken/utils/object_handeling.py diff --git a/music_kraken/utils/object_handeling.py b/music_kraken/utils/object_handeling.py deleted file mode 100644 index 7922603..0000000 --- a/music_kraken/utils/object_handeling.py +++ /dev/null @@ -1,24 +0,0 @@ -from datetime import date - - -def get_elem_from_obj(current_object, keys: list, after_process=lambda x: x, return_if_none=None): - current_object = current_object - for key in keys: - if key in current_object or (type(key) == int and key < len(current_object)): - current_object = current_object[key] - else: - return return_if_none - return after_process(current_object) - - -def parse_music_brainz_date(mb_date: str) -> date: - year = 1 - month = 1 - day = 1 - - first_release_date = mb_date - if first_release_date.count("-") == 2: - year, month, day = [int(i) for i in first_release_date.split("-")] - elif first_release_date.count("-") == 0 and first_release_date.isdigit(): - year = int(first_release_date) - return date(year, month, day)