Gallery Date Parser

There are enough date parsers in Python, why use a regex and not a module?
See eg parsing - Best way to identify and extract dates from text Python? - Stack Overflow

It’s using date_parser module. Still you can’t just give a random string with lots of other numbers like picture count and what not, and expect the module to parse it.
I originally just used the regx to extract the date part and put it in the module but the results were inconclusive.

But yes the module you shared looks nice. Feel free to do a PR and update the mod to use this instead of the complexe regex.

Requirements for the module is to return both the formatted date and the original string part used to find it because the title is then set by removing the date from the filename

The plugin already uses dateparser so I think it would make sense to use search_dates function for that: since it returns a list of matches the plugin can just bail if it gets 0 or 2+ dates and log a warning about it being ambiguous, or fall back to the regexp matching that it currently uses

Sure even better. Feel free to make the changes if you want, or maybe i’ll do it one day if the current thing breaks. But so far I works well enough for me, and it did for the past two years, so I don’t feel like changing it.

I’ve done it again… I updated the stash docker image, and I can’t run the Gallery Date plugin because I get this error:
[Plugin / Gallery Date Parser] Exception: PythonDepManager: :cross_mark: git is required but not available.
I have the PythonDepManager installed.

What is the right way to fix this?
Thanks.
David

I’m using the latest docker image. I’ve installed git. and I have PythonDepManager installed.
But I get these errors when I try to run Gallery Date Parser.

5-11-05 19:17:38
Error   
Plugin returned error: exit status 1
2025-11-05 19:17:38
Error   
[Plugin / Gallery Date Parser] Exception: 422 Unprocessable Entity query failed. v0.29.2-0
2025-11-05 19:17:38
Error   
[Plugin / Gallery Date Parser]     raise Exception(error_msg)
2025-11-05 19:17:38
Error   
[Plugin / Gallery Date Parser]   File "/root/.stash/plugins/community/py_dependencies/stashapi/stashapi/classes.py", line 271, in _handle_GQL_response
2025-11-05 19:17:38
Error   
[Plugin / Gallery Date Parser]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-11-05 19:17:38
Error   
[Plugin / Gallery Date Parser]     return self._handle_GQL_response(response)
2025-11-05 19:17:38
Error   
[Plugin / Gallery Date Parser]   File "/root/.stash/plugins/community/py_dependencies/stashapi/stashapi/classes.py", line 228, in _GQL
2025-11-05 19:17:38
Error   
[Plugin / Gallery Date Parser]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-11-05 19:17:38
Error   
[Plugin / Gallery Date Parser]     return self._GQL(query, variables)
2025-11-05 19:17:38
Error   
[Plugin / Gallery Date Parser]   File "/root/.stash/plugins/community/py_dependencies/stashapi/stashapi/stashapp.py", line 239, in call_GQL
2025-11-05 19:17:38
Error   
[Plugin / Gallery Date Parser]              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-11-05 19:17:38
Error   
[Plugin / Gallery Date Parser]     result = self.call_GQL(query, variables, callback=callback)
2025-11-05 19:17:38
Error   
[Plugin / Gallery Date Parser]   File "/root/.stash/plugins/community/py_dependencies/stashapi/stashapi/stashapp.py", line 1439, in find_galleries
2025-11-05 19:17:38
Error   
[Plugin / Gallery Date Parser]                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-11-05 19:17:38
Error   
[Plugin / Gallery Date Parser]     galleries = stash.find_galleries(f={"is_missing": "date"})
2025-11-05 19:17:38
Error   
[Plugin / Gallery Date Parser]   File "/root/.stash/plugins/community/date_parser/date_parser.py", line 50, in find_date_for_galleries
2025-11-05 19:17:38
Error   
[Plugin / Gallery Date Parser]     find_date_for_galleries(settings)
2025-11-05 19:17:38
Error   
[Plugin / Gallery Date Parser]   File "/root/.stash/plugins/community/date_parser/date_parser.py", line 28, in main
2025-11-05 19:17:38
Error   
[Plugin / Gallery Date Parser]     main()
2025-11-05 19:17:38
Error   
[Plugin / Gallery Date Parser]   File "/root/.stash/plugins/community/date_parser/date_parser.py", line 83, in <module>
2025-11-05 19:17:38
Error   
[Plugin / Gallery Date Parser] Traceback (most recent call last):
2025-11-05 19:17:38
Error   
[Plugin / Gallery Date Parser] d
2025-11-05 19:17:38
Error   
[Plugin / Gallery Date Parser] 422 Unprocessable Entity query failed. v0.29.2-0
2025-11-05 19:17:38
Error   
[Plugin / Gallery Date Parser] 422 Unprocessable Entity GQL data response is null
2025-11-05 19:17:38
Error   
[Plugin / Gallery Date Parser] GRAPHQL_VALIDATION_FAILED: Field "fingerprint" argument "type" of type "String!" is required, but it was not provided.
2025-11-05 19:17:38
Error   
[Plugin / Gallery Date Parser] GRAPHQL_VALIDATION_FAILED: Field "fingerprint" argument "type" of type "String!" is required, but it was not provided.
2025-11-05 19:17:38
Error   
[Plugin / Gallery Date Parser] GRAPHQL_VALIDATION_FAILED: Field "fingerprint" argument "type" of type "String!" is required, but it was not provided.
2025-11-05 19:17:38
Error   
[Plugin / Gallery Date Parser] GRAPHQL_VALIDATION_FAILED: Field "fingerprint" argument "type" of type "String!" is required, but it was not provided.
2025-11-05 19:17:38
Error   
[Plugin / Gallery Date Parser] GRAPHQL_VALIDATION_FAILED: Cannot spread fragment "Folder" within itself.
2025-11-05 19:17:38
Error   
[Plugin / Gallery Date Parser] GRAPHQL_VALIDATION_FAILED: Cannot spread fragment "Folder" within itself via "BasicFile".

stashapp-tools / stashapp-api might need an update, if it doesn’t work then the plugin likely needs to be update to include explicit fragments

I would have said that also. Try an manually update stashapi to it’s latest version.
If I remember correctly I’m not specifying any fragments in the code so it should have stayed compatible. But it might be that the input of something changed. Maybe the filters ? I’ve not used stash in some months. So I’m not sure.