2023-10-23, 06:10 PM
(This post was last modified: 2023-10-23, 06:21 PM by Manly Manlison. Edited 1 time in total.)
I found the last piece of the puzzle and thought I'd share this to anyone else running into the same use case. I don't know if there will be an official feature of this in the future, so just in case I've made a redneck solution that my users can do to fix the weird cache issues they've sometimes had due to me changing up stuff in the web folder frequently - and hopefully their issues can be fixed with as little guidance as needed.
The approach I took to clear cache was:
Windows:
I made a powershell script that only removes the Jellyfin Media Player folder, by creating a new text file and then changing the extension from .txt to .ps1
If you then run the below code in elevated PowerShell, you can turn your script into an .exe file
The .exe is going to be unsigned and from what I could understand, signing an app is locked behind a paywall which I didn't care much for so you will be met with a warning when running the unsigned .exe
which kinda sucks but meh you press more info and run anyway and you're gucci
Mac:
Creating a script in Mac and moving it to another Mac quickly seemed impossibly hard to do, since the OS just blocks the file and forces the user to jump through a couple of hoops just to open the damn file. Too much of a hassle.. So I found out that you can pass the script through Applescript Editor which is built into the OS.
So we save the script as an unsigned script, which as default opens in the editor, making it more like a project file with the code already pasted in.
Doing it this way, we basically have their computer think that their own user is the mastermind behind this script and runs the script with no security block/message.
They just have to press the play button:
and it passes the script on to Terminal
The code:
Initially I only thought I needed to delete the folder in ~/Library/Caches/'Jellyfin Media Player' but it didn't do the same thing as it did in Windows, as there's another web cache folder in ~/Library/'Application Support'/'Jellyfin Media Player'/QtWebEngine" that I missed in my first try.
I don't know the difference between those two folders, but deleting them just makes Jellyfin Media Player recreate the folders and the items inside, so it shouldn't break anything if I just delete both
Now for it to be as user friendly as possible, I've done this:
I added a menu button for support:
And pressing it links into a basic html page where my users can easily download the proper clients as well as find the scripts I've made:
I'm not sure if I'm allowed to upload the finished .exe file and the .scpt file so just PM me if you want the files
The approach I took to clear cache was:
Windows:
I made a powershell script that only removes the Jellyfin Media Player folder, by creating a new text file and then changing the extension from .txt to .ps1
Code:
Set-Location "$($env:UserProfile)\AppData\Local\"
Remove-Item 'Jellyfin Media Player' -Recurse
If you then run the below code in elevated PowerShell, you can turn your script into an .exe file
Code:
Install-Module ps2exe
Invoke-PS2EXE C:\location\of\script.ps1 C:\clearcache.exe
The .exe is going to be unsigned and from what I could understand, signing an app is locked behind a paywall which I didn't care much for so you will be met with a warning when running the unsigned .exe
which kinda sucks but meh you press more info and run anyway and you're gucci
Mac:
Creating a script in Mac and moving it to another Mac quickly seemed impossibly hard to do, since the OS just blocks the file and forces the user to jump through a couple of hoops just to open the damn file. Too much of a hassle.. So I found out that you can pass the script through Applescript Editor which is built into the OS.
So we save the script as an unsigned script, which as default opens in the editor, making it more like a project file with the code already pasted in.
Doing it this way, we basically have their computer think that their own user is the mastermind behind this script and runs the script with no security block/message.
They just have to press the play button:
and it passes the script on to Terminal
The code:
Code:
tell application "Terminal"
do script "rm -rf ~/Library/Caches/'Jellyfin Media Player' ~/Library/'Application Support'/'Jellyfin Media Player'/QtWebEngine"
activate
end tell
Initially I only thought I needed to delete the folder in ~/Library/Caches/'Jellyfin Media Player' but it didn't do the same thing as it did in Windows, as there's another web cache folder in ~/Library/'Application Support'/'Jellyfin Media Player'/QtWebEngine" that I missed in my first try.
I don't know the difference between those two folders, but deleting them just makes Jellyfin Media Player recreate the folders and the items inside, so it shouldn't break anything if I just delete both
Now for it to be as user friendly as possible, I've done this:
I added a menu button for support:
And pressing it links into a basic html page where my users can easily download the proper clients as well as find the scripts I've made:
I'm not sure if I'm allowed to upload the finished .exe file and the .scpt file so just PM me if you want the files