sveetch / deovi

A set of utilities to collect and rename media files
https://deovi.readthedocs.io/
MIT License
2 stars 0 forks source link

[collect] Directory checksum should not use computed cover filename with UUID #5

Closed sveetch closed 1 year ago

sveetch commented 1 year ago

The directory checksum is computed from a full resume of directory and its mediafiles infos, any detail change will trigger a new checksum.

A sample of payload content used to compute checksum:

{
    "absolute_dir": ".",
    "children_files": [
        {
            "absolute_dir": "my_device",
            "container": "Matroska",
            "directory": "",
            "extension": "mkv",
            "mtime": "2023-03-03T15:28:31+00:00",
            "name": "SampleVideo_1280x720_1mb.mkv",
            "path": "my_device/SampleVideo_1280x720_1mb.mkv",
            "relative_dir": ".",
            "size": 1052413
        }
    ],
    "cover": [
        "/home/foo/my_device/cover.png",
        "my_device_5d6a37176464385b2acb/e22299c3-5abd-41cd-988a-71160f9a052a.png"
    ],
    "cover_checksum": "2f959715ba2b43cef4c48e6dfd71d002007f2cf10e1f20029501a7ba41b4edc9d92da877682ebd8e657635902b56827311b20cf21682762e7871fd4afcab951f",
    "mtime": "2023-03-03T15:28:31+00:00",
    "name": "my_device",
    "path": "my_device",
    "relative_dir": ".",
    "size": 4096,
    "title": "Media sample root"
} 

But currently the resume include the computed cover filename that include an UUID4. Since UUID is almost assured to be unique, any collect will have a new checksum because of UUID filename that won't be the same even if the cover file does not change.

So, the computed filename must not be included in the payload used to build directory checksum.

sveetch commented 1 year ago

Fixed in 0.5.2