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

Unnecessarily nested XDG_CACHE_HOME / XDG_DATA_HOME directories #147

Closed
bastimeyer opened this issue May 3, 2019 · 4 comments

Comments

Projects
None yet
2 participants
@bastimeyer
Copy link

commented May 3, 2019

Hi, I've just heard about Strawberry and tried it out for a bit on Arch via the strawberry-git AUR package. I've been using Clementine for years with a slightly modified Clementine-qt5 build, so it's great news that someone decided to continue the work on Clementine in a new fork.

After running Strawberry for a bit, I've noticed an issue with the cache, config and data dirs. It looks like Clementine's behavior of storing data in its config dir was fixed and the data files were moved it to the correct XDG_DATA_HOME dir. However, it seems that both the cache and data dirs are now unnecessarily nested with another strawberry folder, whereas the config dir is not. I'm not sure if that's intended or a bug caused by my explicitly set XDG env vars, which is not the default config on most distros.

$ ls ~/.config/strawberry ~/.cache/strawberry ~/.local/share/strawberry
/home/basti/.cache/strawberry:
strawberry/

/home/basti/.config/strawberry:
strawberry.conf

/home/basti/.local/share/strawberry:
strawberry/

$ echo $XDG_CACHE_HOME $XDG_CONFIG_HOME $XDG_DATA_HOME 
/home/basti/.cache /home/basti/.config /home/basti/.local/share

I've noticed this issue, because I was trying to copy my custom icon set from Clementine to Strawberry and I didn't manage to get it to work. Was this feature removed? I'm using KDE Plasma with a dark macOS-Mojave-like Kvantum theme and both the default icons and my system icons don't work that nicely without a custom icon set.


There's also another issue which confused me a bit, although unrelated to the stuff mentioned above.

On the first application start, I of course started with configuring Strawberry and setting up my collection directories. To my surprise, the sidebar only listed the "Files" menu and I couldn't find the "Collection" menu at all. In confusion, I closed Strawberry, reopened it and noticed that the "Queue" menu was now listed in the sidebar, but the "Collection" menu was still missing. I kept searching for it and restarted Strawberry again and this time, a third sidebar entry appeared. On the fifth restart, it finally listed the "Collection" menu and I was able to create a new playlist from my collection.

This also leads me to the following question: Can I import my collection data / playlist from Clementine without losing any metadata like play counts, etc?
I've tried replacing the SQLite files, but it didn't work and as a simple user, I don't want to spend time on altering the table structures, data and what not.

Thanks!

@jonaski

This comment has been minimized.

Copy link
Owner

commented May 3, 2019

It's using standard Qt 5 paths, StandardPaths::AppLocalDataLocation for the database, icons, albumcovers etc, and QStandardPaths::CacheLocation for the cache things like the scrobbler cache.
A guide to the different locations are here: https://doc.qt.io/qt-5/qstandardpaths.html
For some things this is like companyname/applicationame where both are strawberry so that's why it's twice, this is something Qt 5 does, not something I made up. The only thing I do is to set application name and company both to strawberry and Qt handles the paths.
Clementine is Qt 4 and they never adapted the correct Qt 5 paths even on the Qt5 branch, but if they did the locations would be different and obviously the files needs to be moved from where they was with Qt 4.

You can place icons in ~/.local/share/strawberry/strawberry/icons (on linux) to use custom icons
Subfolders there should be 22, 32, 48 and 64. And using the same names as the icons in https://github.com/jonaski/strawberry/tree/master/data/icons it should load them instead.

As for the missing icons in the tabbar I can't reproduce any problems, but someone else reported that too, what version from git and os do you use?

You can't import the database schemas directly since they are entirely different, you need some scripts to convert them, but you can import saved playlists (with metadata).

@jonaski

This comment has been minimized.

Copy link
Owner

commented May 3, 2019

By the way, I was annoyed by the companyname in the paths too and tried to find a way to work around it, by not setting a company name, but found out it was not possible

@bastimeyer

This comment has been minimized.

Copy link
Author

commented May 3, 2019

~/.local/share/strawberry/strawberry/icons

Ah, ok, I see, it got moved from customiconset/icons to icons. That makes sense... Thanks!
The rest is of course just regular freedesktop icon spec and I can replace the icons by looking at the names from the repo:
https://github.com/jonaski/strawberry/tree/master/data/icons

missing icons in the tabbar
what version from git and os do you use?

strawberry-git 0.5.3.r88.g42de7de-1
Arch is rolling release, so all I can tell you is that my system is up2date.
https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=strawberry-git

database schemas are entirely different

Hm, that's a shame.
I've compared both SQLite DBs and writing a small script shouldn't be too time consuming like I've initially thought if it's just simple playcount and stuff.

@jonaski

This comment has been minimized.

Copy link
Owner

commented May 3, 2019

There was a bug in the recent builds with the tabwidget, see #146
If you try the 96424be build when it's finished it should hopefully be fixed.

@jonaski jonaski closed this May 3, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.