This commit is contained in:
Fredrik Burmester
2024-09-28 20:24:39 +02:00
parent ddcb410df6
commit ff88c45d43
11 changed files with 26 additions and 111 deletions

View File

@@ -39,59 +39,6 @@ const downloads: React.FC = () => {
return Object.values(series);
}, [downloadedFiles]);
useEffect(() => {
(async () => {
const dir = FileSystem.documentDirectory;
if (dir) {
const items = await FileSystem.readDirectoryAsync(dir);
if (items.length === 0) {
console.log("No items found in the document directory.");
return;
}
for (const item of items) {
const fullPath = `${dir}${item}`;
const info = await FileSystem.getInfoAsync(fullPath);
if (info.exists) {
if (info.isDirectory) {
// List items in the directory
// const subItems = await FileSystem.readDirectoryAsync(fullPath);
// if (subItems.length === 0) {
// console.log(`Directory ${item} is empty.`);
// } else {
// console.log(`Items in ${item}:`, subItems);
// // If item ends in m3u8, print the content of the file
// const m3u8Files = subItems.filter((subItem) =>
// subItem.endsWith(".m3u8")
// );
// if (m3u8Files.length === 0) {
// console.log(`No .m3u8 files found in ${item}.`);
// } else {
// for (let subItem of m3u8Files) {
// console.log(
// `Content of ${subItem}:`,
// await FileSystem.readAsStringAsync(
// `${fullPath}/${subItem}`
// )
// );
// }
// }
// }
} else {
console.log(`${item} is a file`);
}
} else {
console.log(`${item} does not exist.`);
}
}
} else {
console.log("Document directory is not available.");
}
})();
}, []);
const insets = useSafeAreaInsets();
return (
@@ -121,9 +68,9 @@ const downloads: React.FC = () => {
<TouchableOpacity
onPress={() => {
clearProcess();
setQueue(async (prev) => {
setQueue((prev) => {
if (!prev) return [];
return [...(await prev).filter((i) => i.id !== q.id)];
return [...prev.filter((i) => i.id !== q.id)];
});
}}
>

View File

@@ -39,7 +39,6 @@ export default function settings() {
code: text,
userId: user?.Id,
});
console.log(res.status, res.statusText, res.data);
if (res.status === 200) {
Haptics.notificationAsync(
Haptics.NotificationFeedbackType.Success

View File

@@ -20,8 +20,6 @@ const page: React.FC = () => {
seasonIndex: string;
};
console.log("seasonIndex", seasonIndex);
const [api] = useAtom(apiAtom);
const [user] = useAtom(userAtom);

View File

@@ -69,13 +69,11 @@ const Page = () => {
useEffect(() => {
const sop = getSortOrderPreference(libraryId, sortOrderPreference);
if (sop) {
console.log("getSortOrderPreference ~", sop, libraryId);
_setSortOrder([sop]);
} else {
_setSortOrder([SortOrderOption.Ascending]);
}
const obp = getSortByPreference(libraryId, sortByPreference);
console.log("getSortByPreference ~", obp, libraryId);
if (obp) {
_setSortBy([obp]);
} else {
@@ -87,7 +85,6 @@ const Page = () => {
(sortBy: SortByOption[]) => {
const sop = getSortByPreference(libraryId, sortByPreference);
if (sortBy[0] !== sop) {
console.log("setSortByPreference ~", sortBy[0], libraryId);
setSortByPreference({ ...sortByPreference, [libraryId]: sortBy[0] });
}
_setSortBy(sortBy);
@@ -99,7 +96,6 @@ const Page = () => {
(sortOrder: SortOrderOption[]) => {
const sop = getSortOrderPreference(libraryId, sortOrderPreference);
if (sortOrder[0] !== sop) {
console.log("setSortOrderPreference ~", sortOrder[0], libraryId);
setOderByPreference({
...sortOrderPreference,
[libraryId]: sortOrder[0],

View File

@@ -99,7 +99,6 @@ function Layout() {
useEffect(() => {
const subscription = ScreenOrientation.addOrientationChangeListener(
(event) => {
console.log(event.orientationInfo.orientation);
setOrientation(event.orientationInfo.orientation);
}
);