Comments (4)
Did some experimenting. I can turn one of these into a PR if you want.
Basically, GoogleMusicActions._sanitizePath
should return either a properly encoded UTF-8 string (which works great for me on Android, but might fail miserably on Windows โย I don't really know anything about how Python and Windows interact on that front) or the lowest common denominator ASCII string. Both options are below.
UTF-8 version
def _sanitizePath(self, name):
name = "".join(i for i in name if i not in "\/:*?<>|,;$%\"\'.`")
if len(name) > 50: name = name[:50]
return name.decode("utf8", "ignore").encode("utf8").strip()
As I said, this works really nicely on Android (and should be fine on Linux), but I don't know how portable this will be.
ASCII version
def _sanitizePath(self, name):
name = "".join(i for i in name if i not in "\/:*?<>|,;$%\"\'.`")
if len(name) > 50: name = name[:50]
return name.decode("utf8", "ignore").encode("ascii", "backslashreplace").replace("\\x", "_x").replace("\\u", "_u").strip()
This results in ugly file names (for instance, Sigur Rรณs
becomes Sigur R_xf3s
) but should work everywhere.
from googlemusic-xbmc.
Thank you, I'll add your fix for the next version.
from googlemusic-xbmc.
Please test this version:
https://app.box.com/s/d0h56sddqomwj46f8amipcebjikpf2w5
from googlemusic-xbmc.
closing for inactivity
from googlemusic-xbmc.
Related Issues (20)
- New API wrapper HOT 8
- 'ascii' codec can't encode character when searching HOT 3
- Crash when playing Station from Browsed Radio in 18.x HOT 3
- Read only OAuth access possible? HOT 1
- Invalid credentials / connection problem HOT 47
- error when playing song HOT 2
- Add an album to queue HOT 3
- Genre only shows titltes instead of albums HOT 2
- Play of the Music over the categorie (added in the last release) is not working HOT 5
- Unplayable item HOT 1
- does not play any songs HOT 6
- Playlist not fully showing HOT 2
- Track sorting HOT 2
- Unable to launch the plugin after update to 1.8 HOT 4
- Can't add album or song to music library HOT 2
- unknown addon id? Testing current branch. HOT 3
- Unable to use the addon HOT 5
- Google Music Fails to start HOT 3
- Unable to play songs HOT 9
- Unable to view all albums
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from googlemusic-xbmc.