aclist / dztui

DayZ GUI server browser and frontend for Linux
https://aclist.github.io/dzgui/dzgui
GNU General Public License v3.0
90 stars 11 forks source link

Feature suggestion: Remove unused Mods #162

Open murkl opened 2 weeks ago

murkl commented 2 weeks ago

An option that deletes all mods from Steam that are no longer needed would be super helpful. So that all mods that are not used by servers from 'My saved servers' are deleted. The reason for this is the large amount of data that some of the mods consume.

aclist commented 2 weeks ago

Thanks for the suggestion. Off the top of my head, the problem I see with this is that the "mods needed by a server" may change from time to time, so there is no definitive list of mods your saved servers need, unless we routinely check and update this list.

Some rhetorical questions/thoughts:

For example, what if you have 10 saved servers but routinely only visit 1? Should we be checking all 9 other servers (takes some time) every time you open your saved servers list? (Mod information is currently only checked when explicitly connecting to a server, not when fetching the saved servers list. It would add to the load time to open the saved servers list.) Or should this info be checked on a one-time basis when the user invokes the "Mod Cleanup" action?

What if you choose to bulk remove mods, but one or more of the servers in your saved servers later add some of those mods to their required list after you deleted them? For example, one minute later.

What if a server in your list is currently unreachable, and we can't obtain its latest modlist? Without that information, when is it safe to delete mods? Should we just proceed anyway, or abort?

Essentially, this feature would have to take a snapshot of all your saved servers at a moment in time and look for mods that don't match this list. What if the user has 100 servers saved?

Should we just look at which mods seem to be infrequently used by system filestamp?

Should we delegate this to the user instead, and show them a checklist of all their mods, letting them bulk delete the ones they want to? (The Options > List installed mods area lets you remove them one by one, so maybe it could be recycled into a checklist.) Maybe the underlying problem isn't the lack of an ability to remove mods that don't match your saved servers, but the lack of an ability to bulk manage mods?

If the user opted for Manual Mod mode (Options menu), there is no programmatic way of bulk-unsubscribing from updates to these mods on Steam unless the user manually invokes the Unsubscribe action. Mod deletion would be temporary here, as I believe Steam would try to recreate the mods.

I, too, noticed that the saved mods on disk tend to balloon in size over time. Usually I just delete everything and let them build up again, although this may be impractical. I'm using the Auto Mod mode, so mods are not tracked by Steam and can be deleted at will.

It does seem intriguing to be able to mark a mod as "stale", i.e., not used by any server in your list, but I'm not sure what would be the right frequency to check that, and how to reconcile the issues mentioned above:

I think there's a potentially viable idea in here, but the power should be delegated to the user:

*However, this doesn't reconcile the issue with Manual Mod mode, since the user would still have to unsubscribe from those mods. Walking them through each Workshop page to unsubscribe (essentially the reverse of the Manual Mod download process) could work, but seems impractical in terms of automation.

Lastly, a lot of biggish mods are what would be considered "base mods" and are used by a lot of different servers. If you ever need to search for a new server via the server browser and join it, having these base mods ready to go saves a lot of download time, since they are so commonly used. Albeit at the expense of wasted disk space.

aclist commented 1 week ago

As a preliminary step, I've added bulk mod deletion to the Testing branch. This feature is accessible via Options > List installed mods. It does not currently show you which mods are "stale", but you can bulk select/unselect mods and use Ctrl+click to add/delete selections before triggering deletion. This won't work correctly with Manual Mod install mode for the reasons mentioned above.

aclist commented 3 days ago

This feature has now been added to the List installed mods table on the Testing branch (5.6.0-beta.5). Clicking Highlight stale will search through servers in your saved servers list and compare their modlists against the mods you have installed locally. If you have mods installed that aren't used on any of those servers, they will be marked in red. You can use this information if you choose to delete them. To unmark these mods, click Unhighlight stale.

Obviously, be warned that it can take some time to check all of your saved servers. And if the server is unreachable at the time you perform the scan, the check won't include those mods. (So some mods marked as stale may be valid). Use this at your own discretion.