Skip to content

Commit

Permalink
Preserve order while removing duplicate videoIds
Browse files Browse the repository at this point in the history
  • Loading branch information
sigma67 committed Sep 5, 2020
1 parent 451ac9e commit 6bd5e6e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion YouTube.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import re
import argparse
import difflib
from collections import OrderedDict
from SpotifyExport import Spotify
import settings

Expand Down Expand Up @@ -82,7 +83,7 @@ def search_songs(self, tracks):
return videoIds

def add_playlist_items(self, playlistId, videoIds):
videoIds = set(videoIds)
videoIds = OrderedDict.fromkeys(videoIds)
self.api.add_playlist_items(playlistId, videoIds)

def get_playlist_id(self, name):
Expand Down

0 comments on commit 6bd5e6e

Please sign in to comment.