diff --git a/backend/app/settings.py b/backend/app/settings.py index c8426af..6c13270 100644 --- a/backend/app/settings.py +++ b/backend/app/settings.py @@ -224,6 +224,8 @@ def determine_type(file_path): return 'Regex Pattern' elif 'custom_formats' in file_path: return 'Custom Format' + elif 'profiles' in file_path: + return 'Quality Profile' return 'Unknown' def interpret_git_status(x, y): diff --git a/frontend/src/components/format/FormatPage.jsx b/frontend/src/components/format/FormatPage.jsx index 7903c72..45996b1 100644 --- a/frontend/src/components/format/FormatPage.jsx +++ b/frontend/src/components/format/FormatPage.jsx @@ -1,10 +1,11 @@ -import { useState, useEffect } from "react"; +import React, { useState, useEffect } from "react"; import FormatCard from "./FormatCard"; import FormatModal from "./FormatModal"; import AddNewCard from "../ui/AddNewCard"; import { getFormats } from "../../api/api"; import FilterMenu from "../ui/FilterMenu"; import SortMenu from "../ui/SortMenu"; +import { Loader } from "lucide-react"; function FormatPage() { const [formats, setFormats] = useState([]); @@ -15,6 +16,15 @@ function FormatPage() { const [filterValue, setFilterValue] = useState(""); const [allTags, setAllTags] = useState([]); const [isCloning, setIsCloning] = useState(false); + const [isLoading, setIsLoading] = useState(true); + + const loadingMessages = [ + "Decoding the custom format matrix...", + "Parsing the digital alphabet soup...", + "Untangling the format spaghetti...", + "Calibrating the format-o-meter...", + "Indexing your media DNA...", + ]; useEffect(() => { fetchFormats(); @@ -30,6 +40,8 @@ function FormatPage() { setAllTags(tags); } catch (error) { console.error("Error fetching formats:", error); + } finally { + setIsLoading(false); } }; @@ -86,6 +98,17 @@ function FormatPage() { return 0; }); + if (isLoading) { + return ( +
+ +

+ {loadingMessages[Math.floor(Math.random() * loadingMessages.length)]} +

+
+ ); + } + return (

Manage Custom Formats

diff --git a/frontend/src/components/profile/ProfileModal.jsx b/frontend/src/components/profile/ProfileModal.jsx index 12362f6..9757f75 100644 --- a/frontend/src/components/profile/ProfileModal.jsx +++ b/frontend/src/components/profile/ProfileModal.jsx @@ -25,6 +25,7 @@ function ProfileModal({ const [formatTags, setFormatTags] = useState([]); const [tagScores, setTagScores] = useState({}); const [tagFilter, setTagFilter] = useState(""); + const [formatFilter, setFormatFilter] = useState(""); const [error, setError] = useState(""); const [isDeleting, setIsDeleting] = useState(false); const [loading, setLoading] = useState(true); @@ -161,8 +162,12 @@ function ProfileModal({ tag.toLowerCase().includes(tagFilter.toLowerCase()) ); + const filteredFormats = customFormats.filter((format) => + format.name.toLowerCase().includes(formatFilter.toLowerCase()) + ); + return ( - + {loading ? (
@@ -170,117 +175,134 @@ function ProfileModal({ ) : ( <> {error &&
{error}
} -
- - setName(e.target.value)} - placeholder="Enter profile name" - className="w-full p-2 border rounded dark:bg-gray-700 dark:text-gray-200 dark:border-gray-600" - /> -
-
- -