smplayer-dev / smplayer

Free Media Player for Windows, Linux and Mac OS with YouTube support.
https://smplayer.info
GNU General Public License v2.0
682 stars 94 forks source link

Keep configurations in separate dedicated dir even for portable install #934

Closed goyalyashpal closed 7 months ago

goyalyashpal commented 8 months ago

Is your feature request related to a problem? Please describe.

The configuration files are scattered all around in "portable install", i.e. "Open configuration folder < Help" A- * (h > o) is same as the root of smplayer installation dir.

This makes it difficult to export or make a backup of configurations for these.

Describe the solution you'd like

Similar to how the configuration folder when the program is installed systemwide (non-portable) shows up to be: %USERPROFILE%/.smplayer, for portable install too, it can be a .smplayer dir inside the root of smplayer install.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context

Contents of the config folder from system-wide install:

$ eza -a "$USERPROFILE/.smplayer"
favorites.m3u8  player_info.ini  radio.m3u8    styles.ass
hdpi.ini        playlist.ini     smplayer.ini  tv.m3u8

I have switched to using scoop package manager to install smplayer, and mpv etc. (details in comment below)

Environment & versions:

Version: 23.12.0 (revision 10207) (64-bit) Portable Edition Using Qt 5.15.2 (compiled with Qt 5.15.2) Using MPV 0.36.0

goyalyashpal commented 8 months ago

The scoop package manager's manifest for smplayer: https://github.com/ScoopInstaller/Extras/blob/f34d6bf791c33007b1a7a5923924dd938c1fa6d0/bucket/smplayer.json#L17-L40

$ # Outputs of these commands shared below:
$ scoop cat smplayer | jq .persist[]
$ scoop cat smplayer | jq -r .pre_install[]      # | bat -pl ps1
$ scoop cat smplayer | jq -r .pre_uninstall[]    # | bat -pl ps1
"screenshots"
"hdpi.ini"
"playlist.ini"
"favorites.m3u8"
"radio.m3u8"
"tv.m3u8"
'hdpi.ini', 'playlist.ini', 'favorites.m3u8', 'radio.m3u8', 'tv.m3u8' | ForEach-Object {
    if (!(Test-Path "$persist_dir\$_")) { New-Item "$dir\$_" | Out-Null }
}
if (Test-Path "$persist_dir\smplayer.ini") { Copy-Item "$persist_dir\smplayer.ini" "$dir\smplayer.ini" }
# The following must be done as SMPlayer deletes the original file which was linked to the persist folder when it saves settings, rather than editing the file.
Copy-Item "$dir\smplayer.ini" "$persist_dir\smplayer.ini"
smplayer-dev commented 7 months ago

I think this is fixed in commit cb08e90

smplayer-dev commented 7 months ago

Please check if this is fixed in the development version: https://github.com/smplayer-dev/smplayer/releases/tag/v23.12.0.10266

goyalyashpal commented 7 months ago

Please check if this is fixed in the development version:

hi! thanks for the updates. i will check them in some days.

as i have already spent way tooo much times managing my app installs in past few days, unfortunately i won't be able to do it soon... but i will try to do it within 15 days.

goyalyashpal commented 7 months ago

hi! yes... have tried using this, and am recording my steps below: (latest v*.10266 unless specified)

config/
├── [favorites|tv|radio].m3u8 
├── hdpi.ini 
└── file_settings/
    └── */
        └── *.ini

so yeah, i'd say it's working now...

goyalyashpal commented 7 months ago

basically, what it boils down to, in context of this new behaviour, is the following:


Original comment

the way scoop works (as relevant to issue at hand) is as follows:

the existing manifest file for smplayer had following scripts for pre_install and pre_uninstall hooks in powershell language. can you determine if these will be needed now or not?

goyalyashpal commented 7 months ago

self hiding as duplicate


basically, what it boils down to, in context of this new behaviour, is the following:

this is crucial as the config dir will be symlinked to the a separate persist directory.