|
|
@ -777,23 +777,39 @@ var TorrentsTable = new Class({ |
|
|
|
this.columns['state_icon'].updateTd = function (td, row) { |
|
|
|
this.columns['state_icon'].updateTd = function (td, row) { |
|
|
|
var state = this.getRowValue(row); |
|
|
|
var state = this.getRowValue(row); |
|
|
|
|
|
|
|
|
|
|
|
if ((state === "forcedDL") || (state === "metaDL")) |
|
|
|
switch (state) { |
|
|
|
|
|
|
|
case "forcedDL": |
|
|
|
|
|
|
|
case "metaDL": |
|
|
|
state = "downloading"; |
|
|
|
state = "downloading"; |
|
|
|
else if (state === "allocating") |
|
|
|
break; |
|
|
|
|
|
|
|
case "allocating": |
|
|
|
state = "stalledDL"; |
|
|
|
state = "stalledDL"; |
|
|
|
else if (state === "forcedUP") |
|
|
|
break; |
|
|
|
|
|
|
|
case "forcedUP": |
|
|
|
state = "uploading"; |
|
|
|
state = "uploading"; |
|
|
|
else if (state === "pausedDL") |
|
|
|
break; |
|
|
|
|
|
|
|
case "pausedDL": |
|
|
|
state = "paused"; |
|
|
|
state = "paused"; |
|
|
|
else if (state === "pausedUP") |
|
|
|
break; |
|
|
|
|
|
|
|
case "pausedUP": |
|
|
|
state = "completed"; |
|
|
|
state = "completed"; |
|
|
|
else if ((state === "queuedDL") || (state === "queuedUP")) |
|
|
|
break; |
|
|
|
|
|
|
|
case "queuedDL": |
|
|
|
|
|
|
|
case "queuedUP": |
|
|
|
state = "queued"; |
|
|
|
state = "queued"; |
|
|
|
else if ((state === "checkingDL") || (state === "checkingUP") || |
|
|
|
break; |
|
|
|
(state === "queuedForChecking") || (state === "checkingResumeData")) |
|
|
|
case "checkingDL": |
|
|
|
|
|
|
|
case "checkingUP": |
|
|
|
|
|
|
|
case "queuedForChecking": |
|
|
|
|
|
|
|
case "checkingResumeData": |
|
|
|
state = "checking"; |
|
|
|
state = "checking"; |
|
|
|
else if ((state === "unknown") || (state === "error") || (state === "missingFiles")) |
|
|
|
break; |
|
|
|
|
|
|
|
case "unknown": |
|
|
|
|
|
|
|
case "error": |
|
|
|
|
|
|
|
case "missingFiles": |
|
|
|
state = "error"; |
|
|
|
state = "error"; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var img_path = 'images/skin/' + state + '.png'; |
|
|
|
var img_path = 'images/skin/' + state + '.png'; |
|
|
|
|
|
|
|
|
|
|
@ -811,26 +827,62 @@ var TorrentsTable = new Class({ |
|
|
|
|
|
|
|
|
|
|
|
// status
|
|
|
|
// status
|
|
|
|
this.columns['status'].updateTd = function (td, row) { |
|
|
|
this.columns['status'].updateTd = function (td, row) { |
|
|
|
var status = this.getRowValue(row); |
|
|
|
var state = this.getRowValue(row); |
|
|
|
if (!status) return; |
|
|
|
if (!state) return; |
|
|
|
|
|
|
|
|
|
|
|
if ((status === "downloading") || (status === "forcedDL") || (status === "metaDL")) |
|
|
|
var status; |
|
|
|
|
|
|
|
switch (state) { |
|
|
|
|
|
|
|
case "downloading": |
|
|
|
status = "Downloading"; |
|
|
|
status = "Downloading"; |
|
|
|
else if ((status === "stalledDL") || (status === "stalledUP") || (status === "allocating")) |
|
|
|
break; |
|
|
|
|
|
|
|
case "stalledDL": |
|
|
|
status = "Stalled"; |
|
|
|
status = "Stalled"; |
|
|
|
else if ((status === "uploading") || (status === "forcedUP")) |
|
|
|
break; |
|
|
|
status = "Uploading"; |
|
|
|
case "metaDL": |
|
|
|
else if (status === "pausedDL") |
|
|
|
status = "Downloading metadata"; |
|
|
|
status = "Paused"; |
|
|
|
break; |
|
|
|
else if (status === "pausedUP") |
|
|
|
case "forcedDL": |
|
|
|
status = "Completed"; |
|
|
|
status = "[F] Downloading"; |
|
|
|
else if ((status === "queuedDL") || (status === "queuedUP")) |
|
|
|
break; |
|
|
|
|
|
|
|
case "allocating": |
|
|
|
|
|
|
|
status = "Allocating"; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case "uploading": |
|
|
|
|
|
|
|
case "stalledUP": |
|
|
|
|
|
|
|
status = "Seeding"; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case "forcedUP": |
|
|
|
|
|
|
|
status = "[F] Seeding"; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case "queuedDL": |
|
|
|
|
|
|
|
case "queuedUP": |
|
|
|
status = "Queued"; |
|
|
|
status = "Queued"; |
|
|
|
else if ((status === "checkingDL") || (status === "checkingUP") || |
|
|
|
break; |
|
|
|
(status === "queuedForChecking") || (status === "checkingResumeData")) |
|
|
|
case "checkingDL": |
|
|
|
|
|
|
|
case "checkingUP": |
|
|
|
status = "Checking"; |
|
|
|
status = "Checking"; |
|
|
|
else if ((status === "unknown") || (status === "error") || (status === "missingFiles")) |
|
|
|
break; |
|
|
|
status = "Error"; |
|
|
|
case "queuedForChecking": |
|
|
|
|
|
|
|
status = "Queued for checking"; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case "checkingResumeData": |
|
|
|
|
|
|
|
status = "Checking resume data"; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case "pausedDL": |
|
|
|
|
|
|
|
status = "Paused"; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case "pausedUP": |
|
|
|
|
|
|
|
status = "Completed"; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case "missingFiles": |
|
|
|
|
|
|
|
status = "Missing Files"; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case "error": |
|
|
|
|
|
|
|
status = "Errored"; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
status = "Unknown"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
td.set('html', status); |
|
|
|
td.set('html', status); |
|
|
|
}; |
|
|
|
}; |
|
|
|