mps-youtube / yewtube

yewtube, forked from mps-youtube , is a Terminal based YouTube player and downloader. No Youtube API key required.
GNU General Public License v3.0
8.07k stars 648 forks source link

Adding a playlist with the same name overwrites previously created one. #1046

Closed kz6wk9 closed 4 years ago

kz6wk9 commented 4 years ago

Adding a music to an existent playlist is overwriting previously created one of the same name instead of appending the new music.

How to reproduce

$ mpsyt

> / ncs cartoon on and on    // Searching for a music.

### All search content..

> add 1 Dance-Electronic    // Playlist "Dance-Electronic" don't exist yet and it's being created right now with the music of index 1 in it.

> / darkside alan walker      // Searching for another music.

> add 1 Dance Electronic    // Playlist "Dance Electronic" don't exist yet because of the space instead of the hyphen and then will be created as "Dance-Electronic" again overwriting the previously created one and erasing any musics in it.

I think the problem here is the verification of already created playlists, it's only verifying playlists with the exact same name that is specified in the command, while the correct would be to do so only after the replacement of spaces with hyphens.

My Environment

$ mpsyt --version

mpsyt version      : 0.2.8
   notes           : released 17 February 2018
pafy version       : 0.5.5 (youtube-dl backend)
youtube-dl version : 2019.12.25
Python version     : 3.8.1 (default, Dec 21 2019, 20:57:38) 
[GCC 9.2.0]
Processor          : 
Machine type       : x86_64
Architecture       : 64bit, ELF
Platform           : Linux-5.4.6-arch3-1-x86_64-with-glibc2.2.5
sys.stdout.enc     : utf-8
default enc        : utf-8
Config dir         : /home/deracinator/.config/mps-youtube
env:TERM           : xterm-termite
env:SHELL          : /bin/zsh
env:LANG           : en_US.UTF-8
$ uname -a

Linux archlinux 5.4.6-arch3-1 #1 SMP PREEMPT Tue, 24 Dec 2019 04:36:53 +0000 x86_64 GNU/Linux
> mpsyt set

Key                 Value                                                                                         
  order             : relevance
  user_order        : 
  max_res           : 1080p
  player            : mpv
  playerargs        : 
  encoder           : 0 [None]
  notifier          : 
  checkupdate       : True
  show_mplayer_keys : True
  fullscreen        : False
  show_status       : True
  columns           : 
  ddir              : /home/deracinator/Downloads/mps
  overwrite         : True
  show_video        : False
  search_music      : True
  window_pos        : 
  window_size       : 
  download_command  : 
  lastfm_username   : 
  lastfm_password   : 
  lastfm_api_key    : 
  lastfm_api_secret : 
  audio_format      : auto
  video_format      : auto
  api_key           : AIzaSyCIM4EzNqi1in22f4Z3Ru3iYvLaY8tc3bo
  autoplay          : False
  set_title         : True
  mpris             : True