jellyfin / jellyfin-server-macos

The menu bar app and package for Jellyfin Server on macOS.
https://jellyfin.org
Mozilla Public License 2.0
58 stars 15 forks source link

[Issue]: macOs paths are incorrect #75

Open bestlem opened 1 month ago

bestlem commented 1 month ago

Please describe your bug

The default paths for macOS are not correct. See Helper/StartupHelpers.cs and Apple Documentation I think of the directory split as bing like XDG rather than windows but just in different place

The data directory (~/Library/Application Support/Jellyfin) is correct but others aren't

Definitely wrong Cache Directory should be ~/Library/Caches/Jellyfin - putting it there means that cleaning cache is consistent among apps and you don't have to hunt all over to find things taking up disk space and you can also easily ignore in backups Log Directory - ~/Library/Logs/Jellyfin - just consistent with other apps.

Arguably Config Directory - ~/Library/Preferences/Jellyfin

If strictly following Apple guidelines all the directories Jellyfin mentioned above should be org.jellyfin.jellyfin or org.jellyfin.jellyfin-server but many apps don't bother.

Reproduction Steps

Reading code

I note the mac app which is the one I got to tun still uses the old XDG paths.

Jellyfin Version

Weekly unstable (please specify)

if other:

10.9.1 from Mac installer

Environment

- OS: macOS Ventura
- Clients: web and jellyfin iOS app
- Browser: Orion

Jellyfin logs

[2024-05-26 17:07:54.721 +01:00] [INF] [1] Main: Jellyfin version: "10.9.2"
[2024-05-26 17:07:54.739 +01:00] [INF] [1] Main: Environment Variables: ["[JELLYFIN_LOG_DIR, /Users/mark/.local/share/jellyfin/log]"]
[2024-05-26 17:07:54.740 +01:00] [INF] [1] Main: Arguments: ["/Applications/Jellyfin.app/Contents/MacOS/jellyfin.dll", "--webdir", "/Applications/Jellyfin.app/Contents/Resources/jellyfin-web", "--ffmpeg", "/Applications/Jellyfin.app/Contents/MacOS/ffmpeg", "--datadir", "/Users/mark/.local/share/jellyfin"]
[2024-05-26 17:07:54.740 +01:00] [INF] [1] Main: Operating system: "Darwin 23.5.0 Darwin Kernel Version 23.5.0: Wed May  1 20:16:51 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T8103"
[2024-05-26 17:07:54.740 +01:00] [INF] [1] Main: Architecture: Arm64
[2024-05-26 17:07:54.740 +01:00] [INF] [1] Main: 64-Bit Process: True
[2024-05-26 17:07:54.740 +01:00] [INF] [1] Main: User Interactive: True
[2024-05-26 17:07:54.740 +01:00] [INF] [1] Main: Processor count: 8
[2024-05-26 17:07:54.740 +01:00] [INF] [1] Main: Program data path: "/Users/mark/.local/share/jellyfin"
[2024-05-26 17:07:54.740 +01:00] [INF] [1] Main: Log directory path: "/Users/mark/.local/share/jellyfin/log"
[2024-05-26 17:07:54.740 +01:00] [INF] [1] Main: Config directory path: "/Users/mark/.local/share/jellyfin/config"
[2024-05-26 17:07:54.740 +01:00] [INF] [1] Main: Cache path: "/Users/mark/.local/share/jellyfin/cache"
[2024-05-26 17:07:54.740 +01:00] [INF] [1] Main: Web resources path: "/Applications/Jellyfin.app/Contents/Resources/jellyfin-web"
[2024-05-26 17:07:54.740 +01:00] [INF] [1] Main: Application directory: "/Applications/Jellyfin.app/Contents/MacOS/"

FFmpeg logs

No response

Please attach any browser or client logs here

No response

Please attach any screenshots here

No response

Code of Conduct

jellyfin-bot commented 1 month ago

Hi, it seems like your issue report has the following item(s) that need to be addressed:

This is an automated message, currently under testing. Please file an issue here if you encounter any problems.

gnattu commented 1 month ago

I note the mac app which is the one I got to tun still uses the old XDG paths.

Because it is impossible to migrate to new location just by moving folders. The databases will contain path info and if you just move them it will not work. So for a system with old installation the old path will be kept.

For similar reason, another migration breaks each and every current install is very very not feasible. You cannot just say "this is better" and breaks all current installs. No way.

bestlem commented 1 month ago

@gnattu I understand you However the code change in StartupHelpers.cs did change the paths so your reasoning has been rejected by those who changed the code. What is wrong here is that if you are going to change the code you should get it correct.

systemcrash commented 1 month ago

I note the mac app which is the one I got to tun still uses the old XDG paths.

The databases will contain path info and if you just move them it will not work.

Wait - so the full path is baked into the DB?

gnattu commented 1 month ago

However the code change in StartupHelpers.cs did change the paths so your reasoning has been rejected by those who changed the code.

It is a platform-independent change, not a macOS specific change. For both Windows and macOS, we are keeping the old path when an old path install is detected. For Linux, a lot of users use docker or other container technology so the default path does not matter any way, and for our official .deb packages we do overwrite the default paths to a pre-defined location but that path did not change for years iirc.

What is wrong here is that if you are going to change the code you should get it correct.

That change is made years ago. Now you want to make new changes. And users are already having installs with this path. Do you see the problem now?

gnattu commented 1 month ago

I note the mac app which is the one I got to tun still uses the old XDG paths.

The databases will contain path info and if you just move them it will not work.

Wait - so the full path is baked into the DB?

Yes, for a lot of items there will be an absolute path to your data dir.

bestlem commented 1 month ago

What is wrong here is that if you are going to change the code you should get it correct.

That change is made years ago. Now you want to make new changes. And users are already having installs with this path. Do you see the problem now?

No problem for the main errors - Logs and Caches - It does not matter what was there before.

Others yes migration is complex.