Switch speedLimitOfActiveTorrents to camel case
This commit is contained in:
@@ -13,7 +13,7 @@
|
|||||||
"displayActiveTorrents": {
|
"displayActiveTorrents": {
|
||||||
"label": "Display active torrents"
|
"label": "Display active torrents"
|
||||||
},
|
},
|
||||||
"SpeedLimitOfActiveTorrents": {
|
"speedLimitOfActiveTorrents": {
|
||||||
"label": "Upload speed to consider a torrent as active (kB/s)"
|
"label": "Upload speed to consider a torrent as active (kB/s)"
|
||||||
},
|
},
|
||||||
"displayStaleTorrents": {
|
"displayStaleTorrents": {
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ describe('TorrentTile', () => {
|
|||||||
labelFilterIsWhitelist: false,
|
labelFilterIsWhitelist: false,
|
||||||
displayCompletedTorrents: true,
|
displayCompletedTorrents: true,
|
||||||
displayActiveTorrents: true,
|
displayActiveTorrents: true,
|
||||||
SpeedLimitOfActiveTorrents: 10,
|
speedLimitOfActiveTorrents: 10,
|
||||||
displayStaleTorrents: false,
|
displayStaleTorrents: false,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -58,7 +58,7 @@ describe('TorrentTile', () => {
|
|||||||
labelFilterIsWhitelist: false,
|
labelFilterIsWhitelist: false,
|
||||||
displayCompletedTorrents: true,
|
displayCompletedTorrents: true,
|
||||||
displayActiveTorrents: true,
|
displayActiveTorrents: true,
|
||||||
SpeedLimitOfActiveTorrents: 10,
|
speedLimitOfActiveTorrents: 10,
|
||||||
displayStaleTorrents: true,
|
displayStaleTorrents: true,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -95,7 +95,7 @@ describe('TorrentTile', () => {
|
|||||||
labelFilterIsWhitelist: false,
|
labelFilterIsWhitelist: false,
|
||||||
displayCompletedTorrents: false,
|
displayCompletedTorrents: false,
|
||||||
displayActiveTorrents: false,
|
displayActiveTorrents: false,
|
||||||
SpeedLimitOfActiveTorrents: 10,
|
speedLimitOfActiveTorrents: 10,
|
||||||
displayStaleTorrents: true,
|
displayStaleTorrents: true,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -132,7 +132,7 @@ describe('TorrentTile', () => {
|
|||||||
labelFilterIsWhitelist: false,
|
labelFilterIsWhitelist: false,
|
||||||
displayCompletedTorrents: false,
|
displayCompletedTorrents: false,
|
||||||
displayActiveTorrents: true,
|
displayActiveTorrents: true,
|
||||||
SpeedLimitOfActiveTorrents: 10,
|
speedLimitOfActiveTorrents: 10,
|
||||||
displayStaleTorrents: true,
|
displayStaleTorrents: true,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -173,7 +173,7 @@ describe('TorrentTile', () => {
|
|||||||
labelFilterIsWhitelist: true,
|
labelFilterIsWhitelist: true,
|
||||||
displayCompletedTorrents: true,
|
displayCompletedTorrents: true,
|
||||||
displayActiveTorrents: true,
|
displayActiveTorrents: true,
|
||||||
SpeedLimitOfActiveTorrents: 10,
|
speedLimitOfActiveTorrents: 10,
|
||||||
displayStaleTorrents: true,
|
displayStaleTorrents: true,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -210,7 +210,7 @@ describe('TorrentTile', () => {
|
|||||||
labelFilterIsWhitelist: false,
|
labelFilterIsWhitelist: false,
|
||||||
displayCompletedTorrents: false,
|
displayCompletedTorrents: false,
|
||||||
displayActiveTorrents: false,
|
displayActiveTorrents: false,
|
||||||
SpeedLimitOfActiveTorrents: 10,
|
speedLimitOfActiveTorrents: 10,
|
||||||
displayStaleTorrents: true,
|
displayStaleTorrents: true,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ const definition = defineWidget({
|
|||||||
type: 'switch',
|
type: 'switch',
|
||||||
defaultValue: true,
|
defaultValue: true,
|
||||||
},
|
},
|
||||||
SpeedLimitOfActiveTorrents: { // Unit : kB/s
|
speedLimitOfActiveTorrents: { // Unit : kB/s
|
||||||
type: 'number',
|
type: 'number',
|
||||||
defaultValue: 10,
|
defaultValue: 10,
|
||||||
},
|
},
|
||||||
@@ -202,7 +202,7 @@ function TorrentTile({ widget }: TorrentTileProps) {
|
|||||||
export const filterTorrents = (widget: ITorrent, torrents: NormalizedTorrent[]) => {
|
export const filterTorrents = (widget: ITorrent, torrents: NormalizedTorrent[]) => {
|
||||||
let result = torrents;
|
let result = torrents;
|
||||||
if (!widget.properties.displayCompletedTorrents) {
|
if (!widget.properties.displayCompletedTorrents) {
|
||||||
result = result.filter((torrent) => !torrent.isCompleted || (widget.properties.displayActiveTorrents && torrent.uploadSpeed > widget.properties.SpeedLimitOfActiveTorrents * 1024));
|
result = result.filter((torrent) => !torrent.isCompleted || (widget.properties.displayActiveTorrents && torrent.uploadSpeed > widget.properties.speedLimitOfActiveTorrents * 1024));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (widget.properties.labelFilter.length > 0) {
|
if (widget.properties.labelFilter.length > 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user