Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feedback and enhancement suggestions #1

Open
hollanbm opened this issue Dec 17, 2024 · 0 comments
Open

Feedback and enhancement suggestions #1

hollanbm opened this issue Dec 17, 2024 · 0 comments

Comments

@hollanbm
Copy link

Add fastapi, and setup some basic webhooks support. This way the script can be executed by radarr/sonarr post-import. Then you also don’t need to maintain a processed log.

I’m not a huge fan of using a giant text file for tracking files that have been processed. This also has the adverse effect, of not processing files, which have the same name. Which can happen with repacks/propers/v2 if your naming format doesn’t provide absolute uniqueness. Which not everyone’s does.

On top of this, each time you check if a file is processed, you parse the log file, split it, and then iterate over every line checking for existence. If you want to keep this same pattern, I’d look into hashmaps, and just serialize/deserialize on startup/completion. These have O(1) lookup. Redis with a persistent volume/disk, would probably be the industry accepted solution for this. Redis also has O(1) for key lookups.

Here’s something I wrote to help me find and delete files with only non-English tracks. I hate the name. But I do have a fairly barebones devcontainer, contextual logging framework, and poetry for package management. Those are always good additions to any project.

If you do end up using poetry, I’ve got a Dockerfile and GitHub actions you could take a look at in one of my other projects, renamarr.

I’d also look into splitting the script out into various classes. Should help with the testing effort if you do go down that road. Maybe something like this, one class to find/process files, another to find the best language/subs, and then finally one for using mkvmerge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant