nickpegg / mpdsync

Python program to synchronize multiple MPD servers
9 stars 4 forks source link

mpdsync.py: Remove "file: " prefix from song string in full_sync(). #1

Closed alphapapa closed 9 years ago

alphapapa commented 9 years ago

Before this change, I was getting this traceback:

Traceback (most recent call last):
  File "mpdsync.py", line 208, in <module>
    main()
  File "mpdsync.py", line 80, in main
    full_sync(master, slaves)
  File "mpdsync.py", line 176, in full_sync
    slave.client.add(song)
  File "/usr/lib/python2.7/dist-packages/mpd.py", line 167, in <lambda>
    return lambda *args: wrapper(command, args)
  File "/usr/lib/python2.7/dist-packages/mpd.py", line 213, in _execute
    return retval()
  File "/usr/lib/python2.7/dist-packages/mpd.py", line 312, in _fetch_nothing
    line = self._read_line()
  File "/usr/lib/python2.7/dist-packages/mpd.py", line 233, in _read_line
    raise CommandError(error)
mpd.CommandError: [50@0] {add} Not found

Now it works with mpd 0.18.7 and 0.19.1 on Ubuntu 14.04 and Debian Jessie.

alphapapa commented 9 years ago

Also moved config file to ~/.config/mpdsync.json and used XDG module to find $XDG_CONFIG_HOME.

alphapapa commented 9 years ago

Also changed shebang to use /usr/bin/env so the script can be executed properly.

nickpegg commented 9 years ago

Thanks for the /usr/bin/env thing and cleaning up my whitespace! Pretty sure /usr/bin/which didn't work and was a brainfart on my part when I wrote this script long ago.

alphapapa commented 9 years ago

The whitespace fix there was either an accident or a result of using Emacs, but I'm glad it helped. =)