Nukesor / archivebot

:floppy_disk: A telegram bot for backing up and collecting all kinds of media.
MIT License
98 stars 31 forks source link

[IDEA] Temporary directory/name #15

Open adocampo opened 4 years ago

adocampo commented 4 years ago

I'm using this bot to download TVShows episodes and then with PyMedusa, naming them and placing on the right place to Plex Media Server to scan the polished filename.

The problem is medusa isn't aware if the download has finished or not, and it "moves" the file when it's still downloading. Medusa can handle torrent and nbz files and it's aware when the file has finished download because it can speak with the torrent or nbz engine.

Amule has temporary filenames, finished with the .partextension and when finish the download, it renames the file so medusa grabs the proper downloaded file.

I was wondering if archivebot could do something like amule does, like put an extra extension like .part or .unfinished or whatever, so those episode managers couldn't handle the file until archivebot has finished download and renamed the file accordingly.

It can be useful as well for those who don't use those programs as with a single look, someone can know if the file was download properly or if it needs to be downloaded again.

If naming is not possible, perhaps having a temporary folder path is easier to implement, so we can have the incomplete and complete paths and those can be each on a different mountpoint.

Nukesor commented 4 years ago

Saving it to a temporary file and renaming it, should be pretty straight forward. I think the .part extension should do fine.

Since I really don't need this feature, I'll probably not build it myself, but feel free to hack around a little and create a PR.

Nukesor commented 4 years ago

I just added a few comments and rewrote a lot of the existing comments. This project started as a pretty small side-project without having any community in mind :D. Things should be a little more clear now.

adocampo commented 4 years ago

Sorry for the delay. I'm moving to a new flat and I barely have time or strength to put myself in front of a computer these days. But I wanted to take a look into the code to see if I am able to modify it and add the .partextension

Nukesor commented 4 years ago

No problem mate, take your time :) It's not as if this is some kind of critical system that needs to be implemented as soon as possible ;D It's open-source after all, everything is voluntarily

Good luck with your move!