mirror of
https://github.com/streamyfin/streamyfin.git
synced 2025-08-20 18:37:18 +02:00
feat: hide sections when empty by default
This commit is contained in:
@@ -207,7 +207,7 @@ export default function index() {
|
||||
const latestMediaViews = collections.map((c) => {
|
||||
const includeItemTypes: BaseItemKind[] =
|
||||
c.CollectionType === "tvshows" ? ["Series"] : ["Movie"];
|
||||
const title = t("home.recently_added_in", {libraryName: c.Name});
|
||||
const title = t("home.recently_added_in", { libraryName: c.Name });
|
||||
const queryKey = [
|
||||
"home",
|
||||
"recentlyAddedIn" + c.CollectionType,
|
||||
@@ -352,7 +352,7 @@ export default function index() {
|
||||
<View className="flex flex-col items-center justify-center h-full -mt-6 px-8">
|
||||
<Text className="text-3xl font-bold mb-2">{t("home.no_internet")}</Text>
|
||||
<Text className="text-center opacity-70">
|
||||
{t("home.no_internet_message")}
|
||||
{t("home.no_internet_message")}
|
||||
</Text>
|
||||
<View className="mt-4">
|
||||
<Button
|
||||
@@ -393,7 +393,9 @@ export default function index() {
|
||||
return (
|
||||
<View className="flex flex-col items-center justify-center h-full -mt-6">
|
||||
<Text className="text-3xl font-bold mb-2">{t("home.oops")}</Text>
|
||||
<Text className="text-center opacity-70">{t("home.error_message")}</Text>
|
||||
<Text className="text-center opacity-70">
|
||||
{t("home.error_message")}
|
||||
</Text>
|
||||
</View>
|
||||
);
|
||||
|
||||
|
||||
@@ -42,7 +42,8 @@ export const ScrollingCollectionList: React.FC<Props> = ({
|
||||
|
||||
const { t } = useTranslation();
|
||||
|
||||
if (hideIfEmpty === true && data?.length === 0) return null;
|
||||
// hideIfEmpty is deprecated, we always hide when there is no data
|
||||
if (hideIfEmpty === true || data?.length === 0) return null;
|
||||
if (disabled || !title) return null;
|
||||
|
||||
return (
|
||||
|
||||
@@ -28,16 +28,26 @@ export const ScreenOrientationEnum: Record<
|
||||
ScreenOrientation.OrientationLock,
|
||||
string
|
||||
> = {
|
||||
[ScreenOrientation.OrientationLock.DEFAULT]: "home.settings.other.orientations.DEFAULT",
|
||||
[ScreenOrientation.OrientationLock.ALL]: "home.settings.other.orientations.ALL",
|
||||
[ScreenOrientation.OrientationLock.PORTRAIT]: "home.settings.other.orientations.PORTRAIT",
|
||||
[ScreenOrientation.OrientationLock.PORTRAIT_UP]: "home.settings.other.orientations.PORTRAIT_UP",
|
||||
[ScreenOrientation.OrientationLock.PORTRAIT_DOWN]: "home.settings.other.orientations.PORTRAIT_DOWN",
|
||||
[ScreenOrientation.OrientationLock.LANDSCAPE]: "home.settings.other.orientations.LANDSCAPE",
|
||||
[ScreenOrientation.OrientationLock.LANDSCAPE_LEFT]: "home.settings.other.orientations.LANDSCAPE_LEFT",
|
||||
[ScreenOrientation.OrientationLock.LANDSCAPE_RIGHT]: "home.settings.other.orientations.LANDSCAPE_RIGHT",
|
||||
[ScreenOrientation.OrientationLock.OTHER]: "home.settings.other.orientations.OTHER",
|
||||
[ScreenOrientation.OrientationLock.UNKNOWN]: "home.settings.other.orientations.UNKNOWN",
|
||||
[ScreenOrientation.OrientationLock.DEFAULT]:
|
||||
"home.settings.other.orientations.DEFAULT",
|
||||
[ScreenOrientation.OrientationLock.ALL]:
|
||||
"home.settings.other.orientations.ALL",
|
||||
[ScreenOrientation.OrientationLock.PORTRAIT]:
|
||||
"home.settings.other.orientations.PORTRAIT",
|
||||
[ScreenOrientation.OrientationLock.PORTRAIT_UP]:
|
||||
"home.settings.other.orientations.PORTRAIT_UP",
|
||||
[ScreenOrientation.OrientationLock.PORTRAIT_DOWN]:
|
||||
"home.settings.other.orientations.PORTRAIT_DOWN",
|
||||
[ScreenOrientation.OrientationLock.LANDSCAPE]:
|
||||
"home.settings.other.orientations.LANDSCAPE",
|
||||
[ScreenOrientation.OrientationLock.LANDSCAPE_LEFT]:
|
||||
"home.settings.other.orientations.LANDSCAPE_LEFT",
|
||||
[ScreenOrientation.OrientationLock.LANDSCAPE_RIGHT]:
|
||||
"home.settings.other.orientations.LANDSCAPE_RIGHT",
|
||||
[ScreenOrientation.OrientationLock.OTHER]:
|
||||
"home.settings.other.orientations.OTHER",
|
||||
[ScreenOrientation.OrientationLock.UNKNOWN]:
|
||||
"home.settings.other.orientations.UNKNOWN",
|
||||
};
|
||||
|
||||
export const DownloadOptions: DownloadOption[] = [
|
||||
@@ -241,12 +251,11 @@ export const useSettings = () => {
|
||||
if (!api) return;
|
||||
const settings = await api.getStreamyfinPluginConfig().then(
|
||||
({ data }) => {
|
||||
writeInfoLog(`Got remote settings`);
|
||||
writeInfoLog(`Got remote settings: ${data?.settings}`);
|
||||
return data?.settings;
|
||||
},
|
||||
(err) => undefined
|
||||
);
|
||||
|
||||
setPluginSettings(settings);
|
||||
return settings;
|
||||
}, [api]);
|
||||
|
||||
Reference in New Issue
Block a user