mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-12-04 13:49:57 -05:00
Moving FileGroups instead of refreshing files after they have been moved.
This commit is contained in:
parent
6fe8a7b704
commit
0f232fd533
59 changed files with 1902 additions and 1040 deletions
|
|
@ -17,7 +17,7 @@ import {
|
|||
getStatus,
|
||||
getVideo,
|
||||
getVideosStatistics,
|
||||
searchArchives,
|
||||
searchArchives, searchChannels,
|
||||
searchDirectories,
|
||||
searchVideos,
|
||||
searchZim,
|
||||
|
|
@ -1230,4 +1230,31 @@ export const useDockerized = () => {
|
|||
export const useCalcQuery = () => {
|
||||
const [calc, setCalc] = useOneQuery('calc');
|
||||
return {calc, setCalc}
|
||||
}
|
||||
|
||||
export const useSearchChannels = (defaultTagNames) => {
|
||||
const [tagNames, setTagNames] = useState(defaultTagNames || []);
|
||||
const [channels, setChannels] = useState([]);
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
const localSearchChannels = async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const {channels: newChannels} = await searchChannels(tagNames);
|
||||
setChannels(newChannels);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
localSearchChannels();
|
||||
}, [tagNames]);
|
||||
|
||||
return {
|
||||
tagNames,
|
||||
setTagNames,
|
||||
channels,
|
||||
loading,
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue