mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Initial commit
This commit is contained in:
parent
7671d08591
commit
e5a55daf55
20 changed files with 46 additions and 56 deletions
|
@ -1,6 +1,7 @@
|
|||
import type { BaseItemDto } from '@jellyfin/sdk/lib/generated-client/models/base-item-dto';
|
||||
import { BaseItemKind } from '@jellyfin/sdk/lib/generated-client/models/base-item-kind';
|
||||
import type { UserDto } from '@jellyfin/sdk/lib/generated-client/models/user-dto';
|
||||
import { CollectionType } from '@jellyfin/sdk/lib/generated-client/';
|
||||
import escapeHtml from 'escape-html';
|
||||
import type { ApiClient } from 'jellyfin-apiclient';
|
||||
|
||||
|
@ -24,12 +25,12 @@ function getFetchLatestItemsFn(
|
|||
let limit = 16;
|
||||
|
||||
if (enableOverflow) {
|
||||
if (collectionType === 'music') {
|
||||
if (collectionType === CollectionType.Music) {
|
||||
limit = 30;
|
||||
}
|
||||
} else if (collectionType === 'tvshows') {
|
||||
} else if (collectionType === CollectionType.TvShows) {
|
||||
limit = 5;
|
||||
} else if (collectionType === 'music') {
|
||||
} else if (collectionType === CollectionType.Music) {
|
||||
limit = 9;
|
||||
} else {
|
||||
limit = 8;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { appHost } from './apphost';
|
||||
import globalize from '../scripts/globalize';
|
||||
import { CollectionType } from '@jellyfin/sdk/lib/generated-client/';
|
||||
|
||||
export function getDisplayName(item, options = {}) {
|
||||
if (!item) {
|
||||
|
@ -79,7 +80,7 @@ export function supportsAddingToPlaylist(item) {
|
|||
if (isLocalItem(item)) {
|
||||
return false;
|
||||
}
|
||||
if (item.CollectionType === 'livetv') {
|
||||
if (item.CollectionType === CollectionType.LiveTv) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -230,7 +231,7 @@ export function canConvert (item, user) {
|
|||
}
|
||||
|
||||
const collectionType = item.CollectionType;
|
||||
if (collectionType === 'livetv') {
|
||||
if (collectionType === CollectionType.LiveTv) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -249,7 +250,7 @@ export function canConvert (item, user) {
|
|||
export function canRefreshMetadata (item, user) {
|
||||
if (user.Policy.IsAdministrator) {
|
||||
const collectionType = item.CollectionType;
|
||||
if (collectionType === 'livetv') {
|
||||
if (collectionType === CollectionType.LiveTv) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ import viewManager from '../viewManager/viewManager';
|
|||
import ServerConnections from '../ServerConnections';
|
||||
import alert from '../alert';
|
||||
import { ConnectionState } from '../../utils/jellyfin-apiclient/ConnectionState.ts';
|
||||
import { CollectionType } from '@jellyfin/sdk/lib/generated-client/';
|
||||
|
||||
export const history = createHashHistory();
|
||||
|
||||
|
@ -623,7 +624,7 @@ class AppRouter {
|
|||
return '#/details?seriesTimerId=' + id + '&serverId=' + serverId;
|
||||
}
|
||||
|
||||
if (item.CollectionType == 'livetv') {
|
||||
if (item.CollectionType == CollectionType.LiveTv) {
|
||||
return '#/livetv.html';
|
||||
}
|
||||
|
||||
|
@ -662,7 +663,7 @@ class AppRouter {
|
|||
}
|
||||
|
||||
if (context !== 'folders' && !itemHelper.isLocalItem(item)) {
|
||||
if (item.CollectionType == 'movies') {
|
||||
if (item.CollectionType == 'Movies') {
|
||||
url = '#/movies.html?topParentId=' + item.Id;
|
||||
|
||||
if (options && options.section === 'latest') {
|
||||
|
@ -672,7 +673,7 @@ class AppRouter {
|
|||
return url;
|
||||
}
|
||||
|
||||
if (item.CollectionType == 'tvshows') {
|
||||
if (item.CollectionType == CollectionType.TvShows) {
|
||||
url = '#/tv.html?topParentId=' + item.Id;
|
||||
|
||||
if (options && options.section === 'latest') {
|
||||
|
@ -682,7 +683,7 @@ class AppRouter {
|
|||
return url;
|
||||
}
|
||||
|
||||
if (item.CollectionType == 'music') {
|
||||
if (item.CollectionType == CollectionType.Music) {
|
||||
url = '#/music.html?topParentId=' + item.Id;
|
||||
|
||||
if (options?.section === 'latest') {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import type { BaseItemDto } from '@jellyfin/sdk/lib/generated-client';
|
||||
import type { ApiClient } from 'jellyfin-apiclient';
|
||||
import { CollectionType } from '@jellyfin/sdk/lib/generated-client/';
|
||||
import classNames from 'classnames';
|
||||
import React, { FunctionComponent, useEffect, useState } from 'react';
|
||||
|
||||
|
@ -72,7 +73,7 @@ const LiveTVSearchResults: FunctionComponent<LiveTVSearchResultsProps> = ({ serv
|
|||
setPrograms([]);
|
||||
setChannels([]);
|
||||
|
||||
if (query && collectionType === 'livetv') {
|
||||
if (query && collectionType === CollectionType.LiveTv) {
|
||||
const apiClient = ServerConnections.getApiClient(serverId);
|
||||
|
||||
// Movies row
|
||||
|
@ -138,7 +139,7 @@ const LiveTVSearchResults: FunctionComponent<LiveTVSearchResultsProps> = ({ serv
|
|||
'searchResults',
|
||||
'padded-bottom-page',
|
||||
'padded-top',
|
||||
{ 'hide': !query || collectionType !== 'livetv' }
|
||||
{ 'hide': !query || collectionType !== CollectionType.LiveTv }
|
||||
)}
|
||||
>
|
||||
<SearchResultsRow
|
||||
|
|
|
@ -2,6 +2,7 @@ import type { BaseItemDto, BaseItemDtoQueryResult } from '@jellyfin/sdk/lib/gene
|
|||
import type { ApiClient } from 'jellyfin-apiclient';
|
||||
import classNames from 'classnames';
|
||||
import React, { FunctionComponent, useCallback, useEffect, useState } from 'react';
|
||||
import { CollectionType } from '@jellyfin/sdk/lib/generated-client/';
|
||||
|
||||
import globalize from '../../scripts/globalize';
|
||||
import ServerConnections from '../ServerConnections';
|
||||
|
@ -20,11 +21,11 @@ const ensureNonNullItems = (result: BaseItemDtoQueryResult) => ({
|
|||
Items: result.Items || []
|
||||
});
|
||||
|
||||
const isMovies = (collectionType: string) => collectionType === 'movies';
|
||||
const isMovies = (collectionType: string) => collectionType === CollectionType.Movies;
|
||||
|
||||
const isMusic = (collectionType: string) => collectionType === 'music';
|
||||
const isMusic = (collectionType: string) => collectionType === CollectionType.Music;
|
||||
|
||||
const isTVShows = (collectionType: string) => collectionType === 'tvshows' || collectionType === 'tv';
|
||||
const isTVShows = (collectionType: string) => collectionType === CollectionType.TvShows;
|
||||
|
||||
/*
|
||||
* React component to display search result rows for global search and non-live tv library search
|
||||
|
@ -239,7 +240,7 @@ const SearchResults: FunctionComponent<SearchResultsProps> = ({ serverId = windo
|
|||
'searchResults',
|
||||
'padded-bottom-page',
|
||||
'padded-top',
|
||||
{ 'hide': !query || collectionType === 'livetv' }
|
||||
{ 'hide': !query || collectionType === CollectionType.LiveTv }
|
||||
)}
|
||||
>
|
||||
{isLoading ? (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue