How to delete orphaned scripts?

@Liam In my Engine DJ managed collection there were deleted tracks that I had previously analyzed and created the script file with Soundswitch. So now I have scripts in the SSW directory that are no longer linked to any tracks because they were deleted from the collection and also from the computer.

This is visible from the fact that in the SSW directory I have 6130 “.ssfile” files and 5794 “.ssa” files, while my Engine DJ collection is 5598 tracks.

The question is: how can I tell SSW to delete scripts that are no longer used by tracks and therefore are not even visible in the Soundswitch and/or Engine DJ collection?

1 Like

Hello

Every track you have scripted with soundswitch have a tag called “SOUNDSWITCH_ID”. This tag connects the track with correct ssfile file.

You can do a script to read the “SOUNDSWITTCH_ID” tag of your tracks and export it to a list in txt file. This list will have all the names of the ssfile files you need for your tracks. You can then delete all ssfiles files than do not exist in this list.

This is part of a script I have been working on to synchronize playlists to a USB drive from linux, including stems and soundswitch files.

I use “mediainfo” program to read tags of tracks.

I hope this give you ideas to solve your problem.

Regards.

Obtaining a list with the TAG content of each track could also be simple using suitable programs (Mp3Tag or similar).

This could be a big hassle. Having to scroll through about 6000 files to see who is in the list and who is not in the list is a bit of a hassle.


I was wondering if there was some command in Soundswitch to do that. Otherwise, over time, if we continue to analyze tracks that we then delete in the future, we will find the SSW project directory full of useless junk.

If you obtain the list of ssfiles your realy need you can copy them to another location from the script. Then clean the soundswitch folder and copy back the ssfiles in it. There is no need to review the list of files.

Thank you for your help and suggestions.

I can get a text list with the content of the “soundswitch” tags of my tracks, using Mp3Tag. Then once I get the list I do nothing with it because I don’t have a script that can match the content of that text file with my files in the Soundswitch folder. So I should check visually. I am not able to make an automatic script that does this job.

And then another question: why is the number of “ssfile” files different from the “ssa” files? Which of the two contains my scripts of my tracks? What does the other type of file contain?

Give me some time and i’ll post a bash script to do It. This Will run on Linux so you must look for a Windows translation if thats your system.

In mac i think you can run It with little changes but you must go in the same direction and be sure.

Sorry for my english it’s not my language. Regards

1 Like

https://ant.japiworld.com:5443/WebRTCApp/streams/179312683394080457115614.mp4

Here you have a video with script running.

You must have a txt with SOUNDSWITCH_ID list to copy the corresponding files to a “/ssfiles” folder created to it.

This is the script:

#! /bin/bash

while read -r tag do

echo $tag

cp /—FOLDER WITH SSFILES—/“$tag”.* /— PATH TO CREATED FOLDER TO SAVE —/ssfiles/

done < /— PATH TO SOUNDSWITCH_ID LIST FILE TXT—/tags.txt

This works on linux. You must find out how to run on windows or mac.

Say me if you need help to create a list of soundswitch_id txt file.

Hope this will be usefull

Regards

1 Like

Thanks. I’ll try.