mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 21:46:11 +05:00
drop torrent added
This commit is contained in:
@@ -50,18 +50,17 @@ export default function DialogTorrentDetailsContent({ closeDialog, torrent }) {
|
|||||||
const cacheMap = useCreateCacheMap(cache)
|
const cacheMap = useCreateCacheMap(cache)
|
||||||
const settings = useGetSettings(cache)
|
const settings = useGetSettings(cache)
|
||||||
|
|
||||||
const dropTorrent = hash => {
|
const dropTorrent = hash => axios.post(torrentsHost(), { action: 'drop', hash })
|
||||||
axios.post(torrentsHost(), { action: 'drop', hash }).then(() => console.log('torrent dropped'))
|
|
||||||
}
|
|
||||||
|
|
||||||
const { Capacity, PiecesCount, PiecesLength, Filled } = cache
|
const { Capacity, PiecesCount, PiecesLength, Filled } = cache
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const cacheIsLoading = !Object.entries(cache).length
|
const cacheLoaded = !!Object.entries(cache).length
|
||||||
|
const torrentLoaded = torrent.stat_string !== 'Torrent in db' && torrent.stat_string !== 'Torrent getting info'
|
||||||
|
|
||||||
if (cacheIsLoading && !isLoading) setIsLoading(true)
|
if (!cacheLoaded && !isLoading) setIsLoading(true)
|
||||||
if (!cacheIsLoading && isLoading) setIsLoading(false)
|
if (cacheLoaded && isLoading && torrentLoaded) setIsLoading(false)
|
||||||
}, [cache, isLoading])
|
}, [torrent, cache, isLoading])
|
||||||
|
|
||||||
const bufferSize = settings?.PreloadBuffer ? Capacity : 33554432 // Default is 32mb if PreloadBuffer is false
|
const bufferSize = settings?.PreloadBuffer ? Capacity : 33554432 // Default is 32mb if PreloadBuffer is false
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user