WebUI: Use Map instead of Mootools Hash in Torrents table

PR #21308.
This commit is contained in:
skomerko 2024-09-16 11:34:49 +02:00 committed by GitHub
parent e06b7f8f4d
commit 6df1f68ead
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 50 additions and 31 deletions

View file

@ -295,7 +295,7 @@ const initializeWindows = function() {
// check if all selected torrents have same share ratio
for (let i = 0; i < hashes.length; ++i) {
const hash = hashes[i];
const row = torrentsTable.rows[hash].full_data;
const row = torrentsTable.rows.get(hash).full_data;
const origValues = row.ratio_limit + "|" + row.seeding_time_limit + "|" + row.inactive_seeding_time_limit + "|"
+ row.max_ratio + "|" + row.max_seeding_time + "|" + row.max_inactive_seeding_time;
@ -522,7 +522,7 @@ const initializeWindows = function() {
if (hashes.length) {
let enable = false;
hashes.each((hash, index) => {
const row = torrentsTable.rows[hash];
const row = torrentsTable.rows.get(hash);
if (!row.full_data.auto_tmm)
enable = true;
});
@ -570,7 +570,7 @@ const initializeWindows = function() {
const hashes = torrentsTable.selectedRowsIds();
if (hashes.length) {
const hash = hashes[0];
const row = torrentsTable.rows[hash];
const row = torrentsTable.rows.get(hash);
new MochaUI.Window({
id: "setLocationPage",
@ -593,7 +593,7 @@ const initializeWindows = function() {
const hashes = torrentsTable.selectedRowsIds();
if (hashes.length === 1) {
const hash = hashes[0];
const row = torrentsTable.rows[hash];
const row = torrentsTable.rows.get(hash);
if (row) {
new MochaUI.Window({
id: "renamePage",
@ -617,7 +617,7 @@ const initializeWindows = function() {
const hashes = torrentsTable.selectedRowsIds();
if (hashes.length === 1) {
const hash = hashes[0];
const row = torrentsTable.rows[hash];
const row = torrentsTable.rows.get(hash);
if (row) {
new MochaUI.Window({
id: "multiRenamePage",