mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-15 09:46:19 +01:00
Switch to CamelCase for DisplayActiveTorrents var
This commit is contained in:
@@ -10,7 +10,7 @@
|
|||||||
"displayCompletedTorrents": {
|
"displayCompletedTorrents": {
|
||||||
"label": "Display completed torrents"
|
"label": "Display completed torrents"
|
||||||
},
|
},
|
||||||
"displayActiveTorrents": {
|
"DisplayActiveTorrents": {
|
||||||
"label": "Display active torrents"
|
"label": "Display active torrents"
|
||||||
},
|
},
|
||||||
"SpeedLimitOfActiveTorrents": {
|
"SpeedLimitOfActiveTorrents": {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ describe('TorrentTile', () => {
|
|||||||
labelFilter: [],
|
labelFilter: [],
|
||||||
labelFilterIsWhitelist: false,
|
labelFilterIsWhitelist: false,
|
||||||
displayCompletedTorrents: true,
|
displayCompletedTorrents: true,
|
||||||
displayActiveTorrents: true,
|
DisplayActiveTorrents: true,
|
||||||
SpeedLimitOfActiveTorrents: 10,
|
SpeedLimitOfActiveTorrents: 10,
|
||||||
displayStaleTorrents: false,
|
displayStaleTorrents: false,
|
||||||
},
|
},
|
||||||
@@ -57,7 +57,7 @@ describe('TorrentTile', () => {
|
|||||||
labelFilter: [],
|
labelFilter: [],
|
||||||
labelFilterIsWhitelist: false,
|
labelFilterIsWhitelist: false,
|
||||||
displayCompletedTorrents: true,
|
displayCompletedTorrents: true,
|
||||||
displayActiveTorrents: true,
|
DisplayActiveTorrents: true,
|
||||||
SpeedLimitOfActiveTorrents: 10,
|
SpeedLimitOfActiveTorrents: 10,
|
||||||
displayStaleTorrents: true,
|
displayStaleTorrents: true,
|
||||||
},
|
},
|
||||||
@@ -94,7 +94,7 @@ describe('TorrentTile', () => {
|
|||||||
labelFilter: [],
|
labelFilter: [],
|
||||||
labelFilterIsWhitelist: false,
|
labelFilterIsWhitelist: false,
|
||||||
displayCompletedTorrents: false,
|
displayCompletedTorrents: false,
|
||||||
displayActiveTorrents: false,
|
DisplayActiveTorrents: false,
|
||||||
SpeedLimitOfActiveTorrents: 10,
|
SpeedLimitOfActiveTorrents: 10,
|
||||||
displayStaleTorrents: true,
|
displayStaleTorrents: true,
|
||||||
},
|
},
|
||||||
@@ -131,7 +131,7 @@ describe('TorrentTile', () => {
|
|||||||
labelFilter: [],
|
labelFilter: [],
|
||||||
labelFilterIsWhitelist: false,
|
labelFilterIsWhitelist: false,
|
||||||
displayCompletedTorrents: false,
|
displayCompletedTorrents: false,
|
||||||
displayActiveTorrents: true,
|
DisplayActiveTorrents: true,
|
||||||
SpeedLimitOfActiveTorrents: 10,
|
SpeedLimitOfActiveTorrents: 10,
|
||||||
displayStaleTorrents: true,
|
displayStaleTorrents: true,
|
||||||
},
|
},
|
||||||
@@ -172,7 +172,7 @@ describe('TorrentTile', () => {
|
|||||||
labelFilter: ['music', 'movie'],
|
labelFilter: ['music', 'movie'],
|
||||||
labelFilterIsWhitelist: true,
|
labelFilterIsWhitelist: true,
|
||||||
displayCompletedTorrents: true,
|
displayCompletedTorrents: true,
|
||||||
displayActiveTorrents: true,
|
DisplayActiveTorrents: true,
|
||||||
SpeedLimitOfActiveTorrents: 10,
|
SpeedLimitOfActiveTorrents: 10,
|
||||||
displayStaleTorrents: true,
|
displayStaleTorrents: true,
|
||||||
},
|
},
|
||||||
@@ -209,7 +209,7 @@ describe('TorrentTile', () => {
|
|||||||
labelFilter: ['music', 'movie'],
|
labelFilter: ['music', 'movie'],
|
||||||
labelFilterIsWhitelist: false,
|
labelFilterIsWhitelist: false,
|
||||||
displayCompletedTorrents: false,
|
displayCompletedTorrents: false,
|
||||||
displayActiveTorrents: false,
|
DisplayActiveTorrents: false,
|
||||||
SpeedLimitOfActiveTorrents: 10,
|
SpeedLimitOfActiveTorrents: 10,
|
||||||
displayStaleTorrents: true,
|
displayStaleTorrents: true,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ const definition = defineWidget({
|
|||||||
type: 'switch',
|
type: 'switch',
|
||||||
defaultValue: true,
|
defaultValue: true,
|
||||||
},
|
},
|
||||||
displayActiveTorrents: {
|
DisplayActiveTorrents: {
|
||||||
type: 'switch',
|
type: 'switch',
|
||||||
defaultValue: true,
|
defaultValue: true,
|
||||||
},
|
},
|
||||||
@@ -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