popstas / transmission-cli

Transmission PHP client for detect profit torrents and automate weburg.net downloads
http://transmission-cli.popstas.ru
MIT License
18 stars 2 forks source link

transmission-cli torrent-remove-duplicates removes non-duplicates #38

Closed mabushey closed 7 years ago

mabushey commented 7 years ago

I have a collection of about 20 torrents that are like puzzle pieces in a ~400GB blob of files. They are all under one parent directory. The transmission-cli torrent-remove-duplicates command deleted them which caused a lot of work and it's still not back to normal. Just because multiple torrents share the same top level directory tree does NOT make them duplicates. I have seen this numerous times. transmission-cli should have prompted me before it deleted them. At least it told me afterwards so I know what happened.

How do I modify transmission-cli without getting the corrupt checksum error? I have no idea how that's being calculated. I see you're using Symfony, how do you like it? I sat in on one of Fabien's presentations on Symfony at a DrupalCon but in general OO just pisses me off.

I had never heard of the powerlevel9k theme before finding your github repo. I'm using it now, thanks! Also pixel-server looks cool, if I find time I'd like to play with it. I've mostly been using ESP8266 instead of Arduino lately as they are cheaper and much more powerful.

Hope you're having a good day, thanks for the help. :)

popstas commented 7 years ago

@mabushey, I'm so sorry about your corrupted collection... torrent-remove-duplicates assumes that torrents with same name and with same directory is single torrent and removes all except torrent with biggest size. Code here.

Now it have only --dry-run option for safer remove torrents.

Are your removed torrents has same names? Maybe you saved command output after torrents remove?

stats-send command prevents send metrics to influxdb when duplicated torrents detected because if torrents has same names, stats will wrong.

About symfony console: initially purpose of this project was in using symfony ) Before that I written cli utils almost with bash: server-scripts, drupal-scripts, also tried python. I don't used symfony after that, but in this project it fits well: I can easy test each command. While coding I inspired with composer project.

popstas commented 7 years ago

@mabushey, for prevent bugs in future I added allow-duplicates option to config and make torrent-remove-duplicates with confirmation by default. It appears in next release.

But I want to know details about your removed torrents, because I don't know case, when torrent-remove-duplicates can delete useful torrents, maybe bug still present.

mabushey commented 7 years ago

I set up deluge with those torrents. They have the same name, and the parent level dir is also the same as the torrent name. They are set up like:

tree torrent

├── 001-100 ## Here are the files from the first torrent with the same name │   ├── ... files here ├── 101-200 ## Here are the files from the second torrent with the same name │   ├── ... files here ├── 201-300 ## Here are the files from the third torrent with the same name │   ├── ... files here

popstas commented 7 years ago

I found way for correct duplicate detection: duplicate is torrent that have:

I'll try to implement it soon...

mabushey commented 7 years ago

If you ever get to Los Angeles I owe you a few beers! Thanks for all your help with this. :)

popstas commented 7 years ago

@mabushey, now it fixed, please update to v0.7.2 and test on your torrents with --dry-run