Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't play specific songs (probably Unicode related) #2

Closed
trbjo opened this issue Aug 20, 2017 · 6 comments
Closed

Can't play specific songs (probably Unicode related) #2

trbjo opened this issue Aug 20, 2017 · 6 comments

Comments

@trbjo
Copy link

trbjo commented Aug 20, 2017

I have a problem playing a specific song. The bug only exists in your workflow since I don't have any problems playing it in https://github.com/valrus/alfred-mpd. I can send you the song if you want to test it yourself.

@deanishe
Copy link
Owner

I have a problem playing a specific song

I can't possibly help unless you tell me which one…

@trbjo
Copy link
Author

trbjo commented Aug 22, 2017

It concerns all songs that contain special characters i.e. the Danish letters æøå. I can play it from another Alfred-workflow (the https://github.com/valrus/alfred-mpd), so it's not the songs that are corrupted or anything like that. It has no problems showing the characters it just refuses to play the song with the message "error adding: thesonginquestion.mp3: No such directory"
Do you want me to send it to you?

@trbjo
Copy link
Author

trbjo commented Aug 22, 2017

I have the same problems with the Ulysses-alfred workflow. I can hardly read python, but it appears to me that he has used your python library to create his workflow. Could it be that there is a bug somewhere in it?

I'll test it if I come across other workflows that rely on your library.

@deanishe
Copy link
Owner

Do you want me to send it to you?

No, thanks. Just the title/file name that contains non-ASCII characters, please.

Also the error message from Alfred's debugger.

Could it be that there is a bug somewhere in it?

It's very well tested with non-ASCII and is used by hundreds of workflows.

The problem is with the workflows themselves. Handling non-ASCII in Python 2 is a notorious source of errors.

@trbjo
Copy link
Author

trbjo commented Aug 23, 2017

It could be "15 Skøn Er Våren.m4a", but it's basically related to all songs with æ, ø and å.

The debug log is here:

Starting debug for 'MPD'

[2017-08-23 14:32:18][STDERR: input.scriptfilter] 14:32:18 workflow.py:2225 DEBUG Workflow version : 0.1.2
14:32:18 workflow.py:1628 DEBUG Reading settings from /Users/troels/Library/Application Support/Alfred 3/Workflow Data/net.deanishe.alfred.mpd/settings.json ...
14:32:18 workflow.py:2514 DEBUG Update check not due
14:32:18 ampd:686 DEBUG opts={'--help': False,
'--version': False,
'': None,
'': u'',
'do': False,
'search': True,
'stats': False,
'status': False}
14:32:18 ampd:687 DEBUG mpd: host=localhost, port=6600
14:32:18 workflow.py:1859 DEBUG Loading cached data from : /Users/troels/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/net.deanishe.alfred.mpd/__workflow_update_status.cpickle
14:32:18 workflow.py:2444 DEBUG update_data : {u'available': False}
14:32:18 mpd.py:140 DEBUG mpc command: ['stats']
14:32:18 mpd.py:172 DEBUG Finished in 0.01s
14:32:18 mpd.py:228 DEBUG query='whereverwhenever:shakira!', mpc=['whereverwhenever', u'shakira!']
14:32:18 mpd.py:140 DEBUG mpc command: ['search', 'whereverwhenever', 'shakira!']
14:32:18 mpd.py:140 DEBUG mpc command: ['lsplaylists']
14:32:18 mpd.py:172 DEBUG Finished in 0.01s
14:32:18 mpd.py:140 DEBUG mpc command: ['current']
14:32:18 mpd.py:172 DEBUG Finished in 0.01s
14:32:18 mpd.py:140 DEBUG mpc command: ['playlist']
14:32:18 mpd.py:172 DEBUG Finished in 0.01s
14:32:18 ampd:629 DEBUG current=Track(artist=u'Rammstein', album=u'Greatest Hits CD2', disc=u'2', track=u'14', title=u"Du riechst so gut '98", file=u"Rammstein/Greatest Hits CD1/14 Du riechst so gut '98.mp3")
14:32:18 mpd.py:140 DEBUG mpc command: ['status']
14:32:18 mpd.py:172 DEBUG Finished in 0.01s
14:32:18 mpd.py:293 DEBUG status: u"Rammstein\xa0\u266a\xa0Greatest Hits CD2\xa0\u266a\xa02\xa0\u266a\xa014\xa0\u266a\xa0Du riechst so gut '98\xa0\u266a\xa0Rammstein/Greatest Hits CD1/14 Du riechst so gut '98.mp3"
14:32:18 mpd.py:313 DEBUG current track=Track(artist=u'Rammstein', album=u'Greatest Hits CD2', disc=u'2', track=u'14', title=u"Du riechst so gut '98", file=u"Rammstein/Greatest Hits CD1/14 Du riechst so gut '98.mp3")
14:32:18 mpd.py:293 DEBUG status: u'[paused] #4/4 0:08/4:25 (3%)'
14:32:18 mpd.py:299 DEBUG mode=u'paused', pos=4, count=4, pc=3
14:32:18 mpd.py:293 DEBUG status: u'volume:100% repeat: off random: off single: off consume: off'
14:32:18 mpd.py:308 DEBUG volume=100
14:32:18 workflow.py:2423 DEBUG Set last run version : 0.1.2
14:32:18 workflow.py:2267 DEBUG Workflow finished in 0.110 seconds.
[2017-08-23 14:32:23][STDERR: input.scriptfilter] 14:32:23 workflow.py:2225 DEBUG Workflow version : 0.1.2
14:32:23 workflow.py:1628 DEBUG Reading settings from /Users/troels/Library/Application Support/Alfred 3/Workflow Data/net.deanishe.alfred.mpd/settings.json ...
14:32:23 workflow.py:2514 DEBUG Update check not due
14:32:23 ampd:686 DEBUG opts={'--help': False,
'--version': False,
'': None,
'': u'sk\xf8',
'do': False,
'search': True,
'stats': False,
'status': False}
14:32:23 ampd:687 DEBUG mpd: host=localhost, port=6600
14:32:23 ampd:487 INFO query=u'sk\xf8'
14:32:23 mpd.py:140 DEBUG mpc command: ['status']
14:32:23 mpd.py:172 DEBUG Finished in 0.01s
14:32:23 mpd.py:293 DEBUG status: u"Rammstein\xa0\u266a\xa0Greatest Hits CD2\xa0\u266a\xa02\xa0\u266a\xa014\xa0\u266a\xa0Du riechst so gut '98\xa0\u266a\xa0Rammstein/Greatest Hits CD1/14 Du riechst so gut '98.mp3"
14:32:23 mpd.py:313 DEBUG current track=Track(artist=u'Rammstein', album=u'Greatest Hits CD2', disc=u'2', track=u'14', title=u"Du riechst so gut '98", file=u"Rammstein/Greatest Hits CD1/14 Du riechst so gut '98.mp3")
14:32:23 mpd.py:293 DEBUG status: u'[paused] #4/4 0:08/4:25 (3%)'
14:32:23 mpd.py:299 DEBUG mode=u'paused', pos=4, count=4, pc=3
14:32:23 mpd.py:293 DEBUG status: u'volume:100% repeat: off random: off single: off consume: off'
14:32:23 mpd.py:308 DEBUG volume=100
14:32:23 mpd.py:140 DEBUG mpc command: ['playlist']
14:32:23 mpd.py:172 DEBUG Finished in 0.01s
14:32:23 mpd.py:140 DEBUG mpc command: ['search', 'any', 'sk\xc3\xb8']
14:32:23 mpd.py:172 DEBUG Finished in 0.03s
14:32:23 ampd:535 DEBUG 2 result(s) for "skø"
14:32:23 mpd.py:140 DEBUG mpc command: ['current']
14:32:23 mpd.py:172 DEBUG Finished in 0.01s
14:32:23 mpd.py:140 DEBUG mpc command: ['playlist']
14:32:23 mpd.py:172 DEBUG Finished in 0.01s
14:32:23 workflow.py:2423 DEBUG Set last run version : 0.1.2
14:32:23 workflow.py:2267 DEBUG Workflow finished in 0.094 seconds.
[2017-08-23 14:32:24][STDERR: input.scriptfilter] 14:32:23 workflow.py:2225 DEBUG Workflow version : 0.1.2
14:32:23 workflow.py:1628 DEBUG Reading settings from /Users/troels/Library/Application Support/Alfred 3/Workflow Data/net.deanishe.alfred.mpd/settings.json ...
14:32:23 workflow.py:2514 DEBUG Update check not due
14:32:23 ampd:686 DEBUG opts={'--help': False,
'--version': False,
'': None,
'': u'sk\xf8n',
'do': False,
'search': True,
'stats': False,
'status': False}
14:32:23 ampd:687 DEBUG mpd: host=localhost, port=6600
14:32:23 ampd:487 INFO query=u'sk\xf8n'
14:32:23 mpd.py:140 DEBUG mpc command: ['status']
14:32:23 mpd.py:172 DEBUG Finished in 0.01s
14:32:23 mpd.py:293 DEBUG status: u"Rammstein\xa0\u266a\xa0Greatest Hits CD2\xa0\u266a\xa02\xa0\u266a\xa014\xa0\u266a\xa0Du riechst so gut '98\xa0\u266a\xa0Rammstein/Greatest Hits CD1/14 Du riechst so gut '98.mp3"
14:32:23 mpd.py:313 DEBUG current track=Track(artist=u'Rammstein', album=u'Greatest Hits CD2', disc=u'2', track=u'14', title=u"Du riechst so gut '98", file=u"Rammstein/Greatest Hits CD1/14 Du riechst so gut '98.mp3")
14:32:23 mpd.py:293 DEBUG status: u'[paused] #4/4 0:08/4:25 (3%)'
14:32:23 mpd.py:299 DEBUG mode=u'paused', pos=4, count=4, pc=3
14:32:23 mpd.py:293 DEBUG status: u'volume:100% repeat: off random: off single: off consume: off'
14:32:23 mpd.py:308 DEBUG volume=100
14:32:23 mpd.py:140 DEBUG mpc command: ['playlist']
14:32:23 mpd.py:172 DEBUG Finished in 0.01s
14:32:23 mpd.py:140 DEBUG mpc command: ['search', 'any', 'sk\xc3\xb8n']
14:32:23 mpd.py:172 DEBUG Finished in 0.03s
14:32:23 ampd:535 DEBUG 2 result(s) for "skøn"
14:32:23 mpd.py:140 DEBUG mpc command: ['current']
14:32:23 mpd.py:172 DEBUG Finished in 0.01s
14:32:23 mpd.py:140 DEBUG mpc command: ['playlist']
14:32:23 mpd.py:172 DEBUG Finished in 0.01s
14:32:23 workflow.py:2423 DEBUG Set last run version : 0.1.2
14:32:23 workflow.py:2267 DEBUG Workflow finished in 0.087 seconds.
[2017-08-23 14:32:27][utility.debug] .
/------- TRACK -------
query=
vars={
"MAX_RESULTS" = 200;
MPC = "/usr/local/bin/mpc";
"MPD_HOST" = localhost;
"MPD_PASSWORD" = "";
"MPD_PORT" = 6600;
"ampd_action" = play;
"ampd_album" = "For\U00e5rets Danske Sange";
"ampd_artist" = "Danmarks Radios Pigekor";
"ampd_file" = "Danmarks Radios Pigekor/Fora\U030arets Danske Sange/15 Sk\U00f8n Er Va\U030aren.m4a";
"ampd_query" = "sk\U00f8n";
"ampd_reopen" = yes;
"ampd_title" = "Sk\U00f8n Er V\U00e5ren";
}
---------------------/
[2017-08-23 14:32:27][STDERR: input.scriptfilter] 14:32:27 workflow.py:2225 DEBUG Workflow version : 0.1.2
14:32:27 workflow.py:1628 DEBUG Reading settings from /Users/troels/Library/Application Support/Alfred 3/Workflow Data/net.deanishe.alfred.mpd/settings.json ...
14:32:27 workflow.py:2514 DEBUG Update check not due
14:32:27 ampd:686 DEBUG opts={'--help': False,
'--version': False,
'': None,
'': u'sk\xf8n',
'do': False,
'search': True,
'stats': False,
'status': False}
14:32:27 ampd:687 DEBUG mpd: host=localhost, port=6600
14:32:27 ampd:487 INFO query=u'sk\xf8n'
14:32:27 mpd.py:140 DEBUG mpc command: ['status']
14:32:27 mpd.py:172 DEBUG Finished in 0.01s
14:32:27 mpd.py:293 DEBUG status: u"Rammstein\xa0\u266a\xa0Greatest Hits CD2\xa0\u266a\xa02\xa0\u266a\xa014\xa0\u266a\xa0Du riechst so gut '98\xa0\u266a\xa0Rammstein/Greatest Hits CD1/14 Du riechst so gut '98.mp3"
14:32:27 mpd.py:313 DEBUG current track=Track(artist=u'Rammstein', album=u'Greatest Hits CD2', disc=u'2', track=u'14', title=u"Du riechst so gut '98", file=u"Rammstein/Greatest Hits CD1/14 Du riechst so gut '98.mp3")
14:32:27 mpd.py:293 DEBUG status: u'[paused] #4/4 0:08/4:25 (3%)'
14:32:27 mpd.py:299 DEBUG mode=u'paused', pos=4, count=4, pc=3
14:32:27 mpd.py:293 DEBUG status: u'volume:100% repeat: off random: off single: off consume: off'
14:32:27 mpd.py:308 DEBUG volume=100
14:32:27 mpd.py:140 DEBUG mpc command: ['playlist']
14:32:27 mpd.py:172 DEBUG Finished in 0.01s
14:32:27 mpd.py:140 DEBUG mpc command: ['search', 'any', 'sk\xc3\xb8n']
14:32:27 mpd.py:172 DEBUG Finished in 0.04s
14:32:27 ampd:535 DEBUG 2 result(s) for "skøn"
14:32:27 mpd.py:140 DEBUG mpc command: ['current']
14:32:27 mpd.py:172 DEBUG Finished in 0.01s
14:32:27 mpd.py:140 DEBUG mpc command: ['playlist']
14:32:27 mpd.py:172 DEBUG Finished in 0.01s
14:32:27 workflow.py:2423 DEBUG Set last run version : 0.1.2
14:32:27 workflow.py:2267 DEBUG Workflow finished in 0.101 seconds.
[2017-08-23 14:32:27][ERROR: action.script] 14:32:27 workflow.py:2225 DEBUG Workflow version : 0.1.2
14:32:27 workflow.py:1628 DEBUG Reading settings from /Users/troels/Library/Application Support/Alfred 3/Workflow Data/net.deanishe.alfred.mpd/settings.json ...
14:32:27 workflow.py:2514 DEBUG Update check not due
14:32:27 ampd:686 DEBUG opts={'--help': False,
'--version': False,
'': u'play',
'': None,
'do': True,
'search': False,
'stats': False,
'status': False}
14:32:27 ampd:687 DEBUG mpd: host=localhost, port=6600
14:32:27 ampd:157 DEBUG query=u'sk\xf8n', action=u'play', track=Track(artist=u'Danmarks Radios Pigekor', album=u'For\xe5rets Danske Sange', disc=u'', track=u'', title=u'Sk\xf8n Er V\xe5ren', file=u'Danmarks Radios Pigekor/For\xe5rets Danske Sange/15 Sk\xf8n Er V\xe5ren.m4a')
14:32:27 ampd:196 DEBUG queuing and playing song ...
14:32:27 mpd.py:140 DEBUG mpc command: ['playlist']
14:32:27 mpd.py:172 DEBUG Finished in 0.01s
14:32:27 mpd.py:140 DEBUG mpc command: ['add', 'Danmarks Radios Pigekor/For\xc3\xa5rets Danske Sange/15 Sk\xc3\xb8n Er V\xc3\xa5ren.m4a']
14:32:27 mpd.py:161 ERROR command failed: error adding Danmarks Radios Pigekor/Forårets Danske Sange/15 Skøn Er Våren.m4a: No such directory

14:32:27 workflow.py:2423 DEBUG Set last run version : 0.1.2
14:32:27 workflow.py:2267 DEBUG Workflow finished in 0.204 seconds.

deanishe added a commit that referenced this issue Aug 27, 2017
MPD isn't a native Mac app, so it doesn't handle normalisation forms
that don't match the filesystem.
@deanishe
Copy link
Owner

Thanks. That was what I needed to identify the issue. Should be fixed in v0.1.3.

Best guess is that it's because mpc isn't a native macOS program. Native APIs transparently normalise paths to the correct form for the FS. I've changed the default normalisation form in the workflow to match the FS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants