Skip to content

Commit 08064a0

Browse files
authored
Fix/addtorrent duplicates (#3338)
* Report duplicate torrents in the add dialog rtorrent answers a load for an info hash it already has with 0 and no fault, and drops the new copy. addtorrent.php only checked that the load did not fail, so a torrent or magnet that was already loaded was reported as added. rTorrent::loadedHashes() reads the loaded hashes with download_list, once, before anything is loaded. A returned hash that was already loaded, or that an earlier item of the same request added, is reported as Duplicate, and the uploaded copy of a duplicate is not kept. The result pages show it with a new addTorrentDuplicate string, in English in every language file for now, in the alert style; filedrop and the mobile plugin style it the same. * bulk_magnet: report duplicates, not successes sendMagnet() and sendTorrent() return the hash whether rtorrent added the torrent or dropped it as one it already has, so bulk loading reported every duplicate as added. Read the loaded hashes with rTorrent::loadedHashes() before the batch, and count a returned hash that is already loaded, or that an earlier line of the same batch added, as a duplicate. The dialog shows that count with a new bulkAddDuplicate string, in English in every language file for now.
1 parent 19a200f commit 08064a0

62 files changed

Lines changed: 457 additions & 13 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎lang/bn.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ var theUILang =
287287
addTorrentFailedURL : "টরেন্ট যুক্ত করতে ব্যর্থ হয়েছে। URL পুনরুদ্ধার করা যাচ্ছে না।",
288288
addTorrentFailedFile : "টরেন্ট যুক্ত করতে ব্যর্থ হয়েছে। পুনরুদ্ধার করা বিষয়বস্তু একটি বৈধ টরেন্ট ফাইল নয়।",
289289
addTorrentFailedDirectory : "টরেন্ট যুক্ত করতে ব্যর্থ হয়েছে। ভুল ডাউনলোড ডিরেক্টরি উল্লেখ করা হয়েছে।",
290+
addTorrentDuplicate : "The torrent is already loaded and was not added again.",
290291
plgLaunch : "চালু করুন",
291292
plgLocked : "বাধ্যতামূলক",
292293
phpExtensionNotFoundWarning : "কিছু কার্যকারিতা অপ্রাপ্য হবে। পিএইচপি এক্সটেনশন অবশ্যই ইনস্টলড থাকতে হবে।",

‎lang/cs.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ var theUILang =
287287
addTorrentFailedURL : "Failed to add torrent. Can't retrieve URL.",
288288
addTorrentFailedFile : "Failed to add torrent. The retrieved content is not a valid torrent file.",
289289
addTorrentFailedDirectory : "Failed to add torrent. Incorrect downloads directory was specified.",
290+
addTorrentDuplicate : "The torrent is already loaded and was not added again.",
290291
plgLaunch : "Launch",
291292
plgLocked : "Mandatory",
292293
phpExtensionNotFoundWarning : "Some functionality will be unavailable. PHP extension must be installed",

‎lang/da.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ var theUILang =
287287
addTorrentFailedURL : "Kunne ikke tilføje torrent. Kan ikke forbine til URL.",
288288
addTorrentFailedFile : "Kunne ikke tilføje torrent. Den modtagende fil er ikke en valid torrent fil.",
289289
addTorrentFailedDirectory : "Kunne ikke tilføje torrent. Ukorrekt download mappe var specificeret.",
290+
addTorrentDuplicate : "The torrent is already loaded and was not added again.",
290291
plgLaunch : "Start",
291292
plgLocked : "Mandatory",
292293
phpExtensionNotFoundWarning : "Noget funktionalitet vil ikke være tilgængelig. PHP udviddelse skal installeres",

‎lang/de.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ var theUILang =
287287
addTorrentFailedURL : "Fehler beim hinzufügen eines Torrent. URL kann nicht abgerufen werden.",
288288
addTorrentFailedFile : "Fehler beim hinzufügen eines Torrent. Die abgerufene Datei ist keine gültige Torrentdatei.",
289289
addTorrentFailedDirectory : "Fehler beim hinzufügen eines Torrent. Falsches Downloadverzeichnis wurde angegeben.",
290+
addTorrentDuplicate : "The torrent is already loaded and was not added again.",
290291
plgLaunch : "Start",
291292
plgLocked : "Obligatorisch",
292293
phpExtensionNotFoundWarning : "Einige Funktionalitäten stehen nicht zur Verfügung. PHP Erweiterung muss installiert sein.",

‎lang/el.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ var theUILang =
285285
addTorrentFailedURL : "Αποτυχία προσθήκης αρχείου torrent. Αδυναμία ανάκτησης URL.",
286286
addTorrentFailedFile : "Αποτυχία προσθήκης αρχείου torrent. Το ανακτημένο περιεχόμενο δεν είναι έγκυρο αρχείο torrent.",
287287
addTorrentFailedDirectory : "Αποτυχία προσθήκης αρχείου torrent. Έχει οριστεί λάθος φάκελος για τις λήψεις.",
288+
addTorrentDuplicate : "The torrent is already loaded and was not added again.",
288289
plgLaunch : "Εκκίνηση",
289290
plgLocked : "Απαραίτητο",
290291
phpExtensionNotFoundWarning : "Ορισμένες λειτουργίες δεν θα είναι διαθέσιμες. Πρέπει να εγκατασταθεί κάποια προέκταση της PHP",

‎lang/en.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ var theUILang =
287287
addTorrentFailedURL : "Failed to add torrent. Can't retrieve URL.",
288288
addTorrentFailedFile : "Failed to add torrent. The retrieved content is not a valid torrent file.",
289289
addTorrentFailedDirectory : "Failed to add torrent. An incorrect downloads directory was specified.",
290+
addTorrentDuplicate : "The torrent is already loaded and was not added again.",
290291
plgLaunch : "Launch",
291292
plgLocked : "Mandatory",
292293
phpExtensionNotFoundWarning : "Some functionality will be unavailable. A required PHP extension is not installed",

‎lang/es.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ var theUILang =
287287
addTorrentFailedURL : "Fallo al agregar torrent. No se encuentra la URL.",
288288
addTorrentFailedFile : "Fallo al agregar torrent. El contenido no es un torrent válido.",
289289
addTorrentFailedDirectory : "Fallo al agregar torrent. Directorio de descarga incorrecto.",
290+
addTorrentDuplicate : "The torrent is already loaded and was not added again.",
290291
plgLaunch : "Lanzar",
291292
plgLocked : "Obligatorio",
292293
phpExtensionNotFoundWarning : "Algunas funcionalidades no estarán disponibles. Debe tener PHP instalado",

‎lang/fi.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ var theUILang =
287287
addTorrentFailedURL : "Failed to add torrent. Can't retrieve URL.",
288288
addTorrentFailedFile : "Failed to add torrent. The retrieved content is not a valid torrent file.",
289289
addTorrentFailedDirectory : "Failed to add torrent. Incorrect downloads directory was specified.",
290+
addTorrentDuplicate : "The torrent is already loaded and was not added again.",
290291
plgLaunch : "Launch",
291292
plgLocked : "Mandatory",
292293
phpExtensionNotFoundWarning : "Some functionality will be unavailable. PHP extension must be installed",

‎lang/fr.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ var theUILang =
287287
addTorrentFailedURL : "Erreur: le torrent n’a pas pu être ajouté à rTorrent. Impossible de résoudre l’URL.",
288288
addTorrentFailedFile : "Erreur: le torrent n’a pas pu être ajouté à rTorrent. Le contenu récupéré n’est pas un fichier torrent.",
289289
addTorrentFailedDirectory : "Erreur: le torrent n’a pas pu être ajouté à rTorrent. Le répertoire de téléchargement spécifié est incorrect.",
290+
addTorrentDuplicate : "The torrent is already loaded and was not added again.",
290291
plgLaunch : "Démarrage",
291292
plgLocked : "Bloqué",
292293
phpExtensionNotFoundWarning : "Certaines fonctionnalités ne seront pas disponibles. L’extension PHP doit être installée",

‎lang/hu.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ var theUILang =
287287
addTorrentFailedURL : "Nem sikerült torrentet hozzáadni. Nem tudja lekérdezni az URL-t.",
288288
addTorrentFailedFile : "A torrentet nem sikerült hozzáadni. Nem érvényes torrent fájl.",
289289
addTorrentFailedDirectory : "A torrentet nem sikerült hozzáadni. Hibás vagy nemlétező letöltési könyvtár.",
290+
addTorrentDuplicate : "The torrent is already loaded and was not added again.",
290291
plgLaunch : "Indít",
291292
plgLocked : "Kötelező",
292293
phpExtensionNotFoundWarning : "Néhány funkció nem fog működni. PHP kiterjesztést telepíteni kell",

0 commit comments

Comments
 (0)