Code Monkey home page Code Monkey logo

Comments (22)

bobokun avatar bobokun commented on May 26, 2024 1

This wouldn't be an issue since I would have qbit_manage configured to never empty the trash and just let the Unraid plugin handle it.

Okay yes it would be fine if you aren't planning on using qbit_manage to empty the recycle bin.

In terms of implementing this, let me think about this some more and I'll get back to you.

from qbit_manage.

bobokun avatar bobokun commented on May 26, 2024 1

I agree with @Drazzilb08 in that this seems to be a very niche feature that not many will use. I don't want to add additional complexity to the cat section of the config but I have thought of a solution that might work. How about I add something like
split_by_category: true under the recyclebin attribute and that will take whatever your save path you have defined in your category and add the base recyclebin folder (which you defined in the recycle_bin attribute under directory)

from qbit_manage.

KnifeFed avatar KnifeFed commented on May 26, 2024 1

Yup, now it works great! Thanks!

from qbit_manage.

bobokun avatar bobokun commented on May 26, 2024

Thanks for the feedback! When I originally implemented the Recycle Bin feature I intentionally did not name it as .Recycle.Bin because I didn't want qbit_manage to interfere with Unraids Recycle Bin plugin. I suggest you do not combine the recycle bins as you could run into issues. Qbit manage will actually delete any files in that folder regardless of whether or not they came from Qbittorrent. So I would caution keeping them the same.

I also use the same docker volume mapping as you do and I don't see it necessary to have multiple recycle bin folders as each category should have its own save path and when the torrent files get moved to the recycle bin folder it keeps that save path directory. In your example the /movies and /tv directories will end up being created in your recyclebin folder making it easy to distinguish which category your files are in.

Here's an example of how my Recyclebin folder looks like:
image

from qbit_manage.

KnifeFed avatar KnifeFed commented on May 26, 2024

Qbit manage will actually delete any files in that folder regardless of whether or not they came from Qbittorrent. So I would caution keeping them the same.

This wouldn't be an issue since I would have qbit_manage configured to never empty the trash and just let the Unraid plugin handle it. This is what I'm doing currently with Sonarr/Radarr and the recycle bins for the movies/tv shares and it works great.

In your example the /movies and /tv directories will end up being created in your recyclebin folder making it easy to distinguish which category your files are in.

It's not so much an issue of distinguishing the files, but rather a mount/share issue.
Since /data is /mnt/user, if I specify the recycle bin path as e.g. /data/.Recycle.Bin or /data/<something>/.Recycle.Bin it would create a directory in /mnt/user, which Unraid will treat as a user share and a different filesystem, breaking hardlinks.
That's why it would be optimal if I could do:

cat:
  movies:
    path: /data/movies
    recycle_bin: /data/movies/.Recycle.Bin
  tv:
    path: /data/tv
    recycle_bin: /data/tv/.Recycle.Bin

from qbit_manage.

Drazzilb08 avatar Drazzilb08 commented on May 26, 2024

Seeing as how both @bobokun and I run unraid and both use containers for our setups. We've never run into an instance where there would be a need for a per-category recycling bin. I understand that you use a separate share for each of your movies and tv shows however this is actually sub-optimal (proven here). I'd highly suggest setting yourself up something similar to what bobo and I have set up. TRaSH's Guides has to be the most optimal setup to ensure everything runs smoothly this is what we both use.

Personally, I find this request to be a very niche use case, and as most people do not follow a path such as yours.

from qbit_manage.

KnifeFed avatar KnifeFed commented on May 26, 2024

The reason I have separate shares is because of how Unraid's split levels work.
For movies, I've set it up so that a single movie directory and the directory it's hard-linked from, e.g. /mnt/user/movies/library/Movie Name (2022) and /mnt/user/movies/downloads/Movie.Name.2022…, are never split across multiple disks.
For TV, I have it so that a single season directory is never split. This requires two different split levels and hence two different shares.
TRaSH's guides are great but they don't account for this Unraid-specific scenario.

from qbit_manage.

Drazzilb08 avatar Drazzilb08 commented on May 26, 2024

Okay. I can see what you're doing now. You have thought this out quite thoroughly.

from qbit_manage.

KnifeFed avatar KnifeFed commented on May 26, 2024

Here's one of my actual categories:

cat:
  radarr: /data/movies/dl

With your suggestion, that would create /data/movies/dl/<recycle_bin>, right?
It wouldn't be at the root of the share (/data/movies), so I can't use the recycle bin plugin, but I can live with that.

from qbit_manage.

bobokun avatar bobokun commented on May 26, 2024

With your suggestion, that would create /data/movies/dl/<recycle_bin>, right?

Yes that's how it would work

from qbit_manage.

KnifeFed avatar KnifeFed commented on May 26, 2024

Yeah, that would be awesome if it's not too much of a hassle.

from qbit_manage.

bobokun avatar bobokun commented on May 26, 2024

@KnifeFed Can you please switch over to develop branch and test, let me know if you find any bugs

from qbit_manage.

KnifeFed avatar KnifeFed commented on May 26, 2024

Hey. Sorry for the late reply, I've been away all week. Thanks so much for implementing this!

I just tested version 3.1.5 and in my config, I have:

directory:
  root_dir: /data
  recycle_bin: .Recycle.Bin
  torrents_dir: /data/appdata/binhex-qbittorrentvpn/qBittorrent/data/BT_backup
  remote_dir: /data/
  cross_seed:

...

recyclebin:
  enabled: true
  save_torrents: true
  split_by_category: true
  empty_after_x_days:

It did add a recycle bin per category path but it's named .RecycleBin so the recycle_bin option doesn't seem to do anything in this case. Also, it still created an empty .RecycleBin directory in /data (/mnt/user).

from qbit_manage.

bobokun avatar bobokun commented on May 26, 2024

try changing your recycle_bin var to a directory like /.Recycle.Bin

from qbit_manage.

KnifeFed avatar KnifeFed commented on May 26, 2024

I tried recycle_bin: /.Recycle.Bin and it didn't make a difference. They still get named .RecycleBin. Also, as I mentioned, an empty one is created in /data and that happens even when just running the script with --run --dry-run, i.e. no actual task.

from qbit_manage.

bobokun avatar bobokun commented on May 26, 2024

can you try a path that actually exists? Maybe recycle_bin: /data/.Recycle.Bin

from qbit_manage.

bobokun avatar bobokun commented on May 26, 2024

It will automatically create the folder with the default .RecycleBin if the recycle_bin path does not exist.

from qbit_manage.

KnifeFed avatar KnifeFed commented on May 26, 2024

That didn't help either, unfortunately. Is there a way to see where the file would have ended up when doing a dry-run? --debug --trace doesn't give any info regarding this, nor any messages alluding to there not being a recycle bin specified. It's a pretty slow process reproducing this with actual runs.

from qbit_manage.

bobokun avatar bobokun commented on May 26, 2024

Yes --debug would tell you where the file is being moved to if you did have any unregistered torrents, it should show up in the logs. Can you do one more thing and update to the latest develop branch and try again?

from qbit_manage.

KnifeFed avatar KnifeFed commented on May 26, 2024

Yes --debug would tell you where the file is being moved to if you did have any unregistered torrents

It doesn't do that during a dry-run. With --run --skip-recycle --rem-unregistered --dry-run --debug --trace, this is what I get:

|    Torrent Name: Torrent.Name                                                     |
|          Status: TORRENT NOT REGISTERED WITH THIS TRACKER                                                                            |
|         Tracker: https://tracker.domain.tld                                                                                          |
|         Deleted .torrent AND content files.                                                                                          |
|                                                                                                                                      |
| JSON: {'function': 'rem_unregistered', 'title': 'Removing Unregistered Torrents', 'torrent_name': 'Torrent.Name', 'torrent_category': '<CATEGORY_NAME>', 'torrent_status': 'TORRENT NOT REGISTERED WITH THIS TRACKER', 'torrent_tracker': 'https://tracker.domain.tld', 'notifiarr_indexer': None, 'torrents_deleted_and_contents': True, 'body': '   Torrent Name: Torrent.Name\n         Status: TORRENT NOT REGISTERED WITH THIS TRACKER\n        Tracker: https://tracker.domain.tld\n        Deleted .torrent AND content files.'} |
| Webhook: None

What should I set recycle_bin to in the dev build?

from qbit_manage.

KnifeFed avatar KnifeFed commented on May 26, 2024

Alright, I ran the dev build with:

directory:
  root_dir: /data/
  recycle_bin: .Recycle.Bin
  torrents_dir: /data/appdata/binhex-qbittorrentvpn/qBittorrent/data/BT_backup/
  remote_dir: /data/
  cross_seed:

…and now it correctly created /category/path/.Recycle.Bin. That's great! It also created an empty .Recycle.Bin in /data though.

from qbit_manage.

bobokun avatar bobokun commented on May 26, 2024

Okay try updating again, it shouldn't create it anymore.

from qbit_manage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.