chore: linting fixes && github actions for linting (#612)

This commit is contained in:
Ahmed Sbai
2025-03-31 07:44:10 +02:00
committed by GitHub
parent 16b834cf71
commit b9bb109f4a
105 changed files with 604 additions and 570 deletions

View File

@@ -19,7 +19,7 @@ export const Dashboard = () => {
<View>
<ListGroup title={t("home.settings.dashboard.title")} className='mt-4'>
<ListItem
className={sessions.length != 0 ? "bg-purple-900" : ""}
className={sessions.length !== 0 ? "bg-purple-900" : ""}
onPress={() => router.push("/settings/dashboard/sessions")}
title={t("home.settings.dashboard.sessions_title")}
showArrow

View File

@@ -140,7 +140,7 @@ export default function DownloadSettings({ ...props }) {
onPress={() => router.push("/settings/optimized-server/page")}
showArrow
title={t("home.settings.downloads.optimized_versions_server")}
></ListItem>
/>
</ListGroup>
</DisabledSetting>
);

View File

@@ -51,13 +51,13 @@ type ScrollingCollectionListSection = {
orientation?: "horizontal" | "vertical";
};
type MediaListSection = {
type MediaListSectionType = {
type: "MediaListSection";
queryKey: (string | undefined)[];
queryFn: QueryFunction<BaseItemDto>;
};
type Section = ScrollingCollectionListSection | MediaListSection;
type Section = ScrollingCollectionListSection | MediaListSectionType;
export const HomeIndex = () => {
const router = useRouter();
@@ -133,7 +133,7 @@ export const HomeIndex = () => {
useEffect(() => {
const unsubscribe = NetInfo.addEventListener((state) => {
if (state.isConnected == false || state.isInternetReachable === false)
if (state.isConnected === false || state.isInternetReachable === false)
setIsConnected(false);
else setIsConnected(true);
});
@@ -236,7 +236,7 @@ export const HomeIndex = () => {
const title = t("home.recently_added_in", { libraryName: c.Name });
const queryKey = [
"home",
"recentlyAddedIn" + c.CollectionType,
`recentlyAddedIn${c.CollectionType}`,
user?.Id!,
c.Id!,
];
@@ -353,7 +353,8 @@ export const HomeIndex = () => {
parentId: section.items?.parentId,
});
return response.data.Items || [];
} else if (section.nextUp) {
}
if (section.nextUp) {
const response = await getTvShowsApi(api).getNextUp({
userId: user?.Id,
fields: ["MediaSourceCount"],
@@ -363,7 +364,9 @@ export const HomeIndex = () => {
enableRewatching: section.items?.enableRewatching,
});
return response.data.Items || [];
} else if (section.latest) {
}
if (section.latest) {
const response = await getUserLibraryApi(api).getLatestMedia({
userId: user?.Id,
includeItemTypes: section.latest?.includeItemTypes,
@@ -472,7 +475,8 @@ export const HomeIndex = () => {
hideIfEmpty
/>
);
} else if (section.type === "MediaListSection") {
}
if (section.type === "MediaListSection") {
return (
<MediaListSection
key={index}

View File

@@ -20,7 +20,7 @@ export const OptimizedServerForm: React.FC<Props> = ({
return (
<View>
<View className='flex flex-col rounded-xl overflow-hidden pl-4 bg-neutral-900 px-4'>
<View className={`flex flex-row items-center bg-neutral-900 h-11 pr-4`}>
<View className={"flex flex-row items-center bg-neutral-900 h-11 pr-4"}>
<Text className='mr-4'>{t("home.settings.downloads.url")}</Text>
<TextInput
className='text-white'

View File

@@ -81,7 +81,7 @@ export const StorageSettings = () => {
{size && (
<>
<View className='flex flex-row items-center'>
<View className='w-3 h-3 rounded-full bg-purple-600 mr-1'></View>
<View className='w-3 h-3 rounded-full bg-purple-600 mr-1' />
<Text className='text-white text-xs'>
{t("home.settings.storage.app_usage", {
usedSpace: calculatePercentage(size.app, size.total),
@@ -89,7 +89,7 @@ export const StorageSettings = () => {
</Text>
</View>
<View className='flex flex-row items-center'>
<View className='w-3 h-3 rounded-full bg-purple-400 mr-1'></View>
<View className='w-3 h-3 rounded-full bg-purple-400 mr-1' />
<Text className='text-white text-xs'>
{t("home.settings.storage.device_usage", {
availableSpace: calculatePercentage(