Correct duplicate values
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline was successful

This commit is contained in:
Luna 2024-05-07 12:34:24 +02:00
parent a451a97e1c
commit 709c5ebaa8
2 changed files with 8 additions and 4 deletions

View File

@ -355,7 +355,12 @@ class Metadata:
return None return None
list_data = self.id3_dict[field] list_data = self.id3_dict[field]
#correct duplications
correct_list_data = list()
for data in list_data:
if data not in correct_list_data:
correct_list_data.append(data)
list_data = correct_list_data
# convert for example the time objects to timestamps # convert for example the time objects to timestamps
for i, element in enumerate(list_data): for i, element in enumerate(list_data):
# for performances sake I don't do other checks if it is already the right type # for performances sake I don't do other checks if it is already the right type
@ -395,6 +400,5 @@ class Metadata:
""" """
# set the tagging timestamp to the current time # set the tagging timestamp to the current time
self.__setitem__(Mapping.TAGGING_TIME, [ID3Timestamp.now()]) self.__setitem__(Mapping.TAGGING_TIME, [ID3Timestamp.now()])
for field in self.id3_dict: for field in self.id3_dict:
yield self.get_mutagen_object(field) yield self.get_mutagen_object(field)

View File

@ -69,7 +69,7 @@ dependencies = [
"toml~=0.10.2", "toml~=0.10.2",
"typing_extensions~=4.7.1", "typing_extensions~=4.7.1",
"python-sponsorblock~=0.0.0", "python-sponsorblock~=0.1.dev1",
"youtube_dl", "youtube_dl",
] ]
dynamic = [ dynamic = [