Kuoxsr / spindex

A personal tool to generate sounds.json from a folder structure
0 stars 0 forks source link

The script is generating JSON records for folders that have no .ogg files in them #1

Closed Kuoxsr closed 7 months ago

Kuoxsr commented 7 months ago

Affected version/commit

Version 0.16

Steps to reproduce

  1. Create staging area as described in readme
  2. Copy empty folder structure from a previous staging area, one with lots of empty folders
  3. Fill staging area with some .ogg files, but deliberately leave some folders with nothing but .subtitles files
  4. Navigate to the namespace folder of your staging area in a terminal
  5. Type command to run this script on the staging area and press enter

Expected behavior

Folders that had no .ogg files in them should have been ignored.

Resulting behavior

JSON records were created for folders that had no .ogg files in them.

{
    "entity.enderman.scream": {
        "replace": true,
        "sounds": [],
        "subtitle": "subtitles.entity.enderman.ambient"
    },
    "entity.ghast.warn": {
        "replace": true,
        "sounds": [],
        "subtitle": "subtitles.entity.ghast.shoot"
    }
}

Notes

The script appears to be creating a sound event in the JSON for every folder with any file in it, regardless of whether that file is an .ogg file or not.