Is there a program/script?

Carpet Bomb

Member
Oct 29, 2019
176
25
Not sure where I'm supposed to post this but is there a program that will look through your library for lower version scenes/looks/plugins and delete just those? I apologize if this is in the wrong spot
 
Aug 21, 2018
390
523
maybe Boss963 's sharp vam tools does this. Either way it is very simple to script this. An example python script:

Python:
from pathlib import Path
import re
import sys

var_regex = re.compile(r"([^.]+).([^.]+).(\d+).var")


def parse_var_filename(filename):
    matches = var_regex.fullmatch(var_file_path.name)
    creator, package, version = matches.groups()
    return (creator.lower(), package.lower(), int(version))
    

try:
    addondir_path = Path(sys.argv[1])
except Exception:
    print("USAGE: python3 outdated.py <path_to_AddonPackages>")
    exit(1)

latest_version = {}

var_files = list(addondir_path.rglob(r"*.var"))

for var_file_path in var_files:
    try:
        creator, package, version = parse_var_filename(var_file_path.name)
    except Exception as e:
        print(f"Could not parse var file name: {var_file_path}: {e}")
        continue
    latest_known_version = latest_version.get((creator, package))
    if (latest_known_version is None) or (version > latest_known_version):
        latest_version[(creator, package)] = version

for var_file_path in var_files:
    try:
        creator, package, version = parse_var_filename(var_file_path.name)
    except Exception as e:
        print(f"Could not parse var file name: {var_file_path}: {e}")
        continue
    latest_known_version = latest_version.get((creator, package))
    if version < latest_known_version:
        print(f"{var_file_path}")
This can probably be done in powershell too so you don't need to have python installed. But powershell destroys whatever remaining braincells I have.
 

Carpet Bomb

Member
Oct 29, 2019
176
25
maybe Boss963 's sharp vam tools does this. Either way it is very simple to script this. An example python script:

Python:
from pathlib import Path
import re
import sys

var_regex = re.compile(r"([^.]+).([^.]+).(\d+).var")


def parse_var_filename(filename):
    matches = var_regex.fullmatch(var_file_path.name)
    creator, package, version = matches.groups()
    return (creator.lower(), package.lower(), int(version))
   

try:
    addondir_path = Path(sys.argv[1])
except Exception:
    print("USAGE: python3 outdated.py <path_to_AddonPackages>")
    exit(1)

latest_version = {}

var_files = list(addondir_path.rglob(r"*.var"))

for var_file_path in var_files:
    try:
        creator, package, version = parse_var_filename(var_file_path.name)
    except Exception as e:
        print(f"Could not parse var file name: {var_file_path}: {e}")
        continue
    latest_known_version = latest_version.get((creator, package))
    if (latest_known_version is None) or (version > latest_known_version):
        latest_version[(creator, package)] = version

for var_file_path in var_files:
    try:
        creator, package, version = parse_var_filename(var_file_path.name)
    except Exception as e:
        print(f"Could not parse var file name: {var_file_path}: {e}")
        continue
    latest_known_version = latest_version.get((creator, package))
    if version < latest_known_version:
        print(f"{var_file_path}")
This can probably be done in powershell too so you don't need to have python installed. But powershell destroys whatever remaining braincells I have.
Hm this script seemed not to work. wish i knew how to help you but ya im no coder bro. I really appreciate the help
 

ergo36

Member
Oct 24, 2021
394
1,497
A warning. Some authors have different looks in morphs/clothes/textures in different versions for scenes. If you do that you will lose those looks.

Some clothes/hair VARs have different assets in different versions. If you do that you will lose those assets and any VARs that require won't work.

Some plugins are not compatible with previous versions or are in different paths. If the scene requires that plugin it might not work.

And so on.

Unfortunately creators don't use good practices and in the end mess up things.
 

Carpet Bomb

Member
Oct 29, 2019
176
25
I just used it. Unfortunately it really doesn't like how many var's i have. So its pretty sketchy. Looks more and more like I might just have to do it manually:( Its hard to figure out what i need and don't need which makes it hard to figure out what to trim. Some scenes are just monstrous so i need a smaller library to be able to load it. But I really appreciate yall trying to help me out. and thank you ergo for the heads up.
 

Arunty42

Member
Donor
Apr 6, 2024
256
2,849
I just used it. Unfortunately it really doesn't like how many var's i have. So its pretty sketchy. Looks more and more like I might just have to do it manually:( Its hard to figure out what i need and don't need which makes it hard to figure out what to trim. Some scenes are just monstrous so i need a smaller library to be able to load it. But I really appreciate yall trying to help me out. and thank you ergo for the heads up.
If its just loading time and not disk space you can use https://f95zone.to/threads/browserassist-2024-12-28-jayjaywon.149761/ with the new var manager. 30k+ vars no problem or
 

Carpet Bomb

Member
Oct 29, 2019
176
25
If its just loading time and not disk space you can use https://f95zone.to/threads/browserassist-2024-12-28-jayjaywon.149761/ with the new var manager. 30k+ vars no problem or
just tried using jays and it wont find for some reason hm it saw it in manager tho. The biggest problem for me is not the preview/selection screen. Its actually loading a scene. like that scene i posted will crash vam if there are alot of vars. Well more like stall it out
 

Carpet Bomb

Member
Oct 29, 2019
176
25