Moving FileGroups instead of refreshing files after they have been moved.

This commit is contained in:
Roland 2024-08-15 19:32:01 -06:00
parent 6fe8a7b704
commit 0f232fd533
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
59 changed files with 1902 additions and 1040 deletions

View file

@ -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,
}
}