-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Detect duplicate mods #17
Comments
Just a quick question, would this be checking if there are duplicate mods / folders? |
No, but that should probably also be a feature. I'm not sure if detecting conflicting assets is a good idea because I'm pretty sure there's no way to set up a mod load order without rewriting how the program sets up the mods. Even then, I don't think it would be worth it since the mod manager doesn't inject the mods into the game, I wanna say The mod manager is just a file manager. |
A simple duplicate check might be enough to see if two mods change the same file. |
Something like:
```python
import os
def has_duplicates(path, recursive=False) -> list:
""" Return a list of duplicate files
path: The path to scan the files for
recursive: Should the scan be recursively iterating through files?
Return: a list of duplicate folders. The list is empty if there
are no duplicates.
"""
files = [i for i in os.listdir(path) if os.path.isfile(i)]
duplicates = []
for i in files:
files.pop(i)
if i in files:
duplicates.append(i)
```
… On 23/10/28 12:46PM, costantino2000 wrote:
A simple duplicate check might be enough to see if two mods change the same file.
Just having a popup with a list of conflicting mods (showing which files are duplicates) would be enough, instead of relying on an external tool.
--
Reply to this email directly or view it on GitHub:
#17 (comment)
You are receiving this because you commented.
Message ID: ***@***.***>
|
Sadly I discovered that it's not that easy. |
This might be too much, but do you think we could look at the actual files it's replacing and mark them as being in-use in a list for the whole function. We can use os.walk to achieve this I think. Although it may be performance heavy |
One way to increase the performance might be to cache the files.
Maybe something like recursively iterating through the mods and then
dumping the file name and file size and any other data into a .json file.
Then, when files need to be compared, the cache can be used instead of
querying the actual file itself?
… On 23/10/29 09:48AM, Wolfmyths wrote:
> I guess a correct approach would also need to check the subpath and maybe the file size, but I don't know if it would work for every case.
This might be too much, but do you think we could look at the actual files it's replacing and mark them as being in-use in a list for the whole function. We can use os.walk to achieve this I think. Although it may be performance heavy
--
Reply to this email directly or view it on GitHub:
#17 (comment)
You are receiving this because you commented.
Message ID: ***@***.***>
|
It might work and that was my original idea, but I saw that some mods like custom outfits share the same folder structure, so they will show as duplicates even if they are not. |
There should be a way to detect if there are conflicting mods in mod_overrides.
If there are conflicting mods, ask the user which one to keep enabled.
The user will have the option to ignore this operation, but the mod will be red in the UI.
The text was updated successfully, but these errors were encountered: