1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Use getUri from SDK

This commit is contained in:
viown 2025-01-22 23:26:20 +03:00
parent 7cec3dfb53
commit 1e8ea6b7ee
3 changed files with 5 additions and 26 deletions

View file

@ -15,16 +15,13 @@ type LogItemProps = {
const LogItemList: FunctionComponent<LogItemProps> = ({ logs }: LogItemProps) => {
const { api } = useApi();
// TODO: Use getUri from TS SDK once available.
const getLogFileUrl = (logFile: LogFile) => {
if (!api) return '';
let url = api.basePath + '/System/Logs/Log';
url += '?name=' + encodeURIComponent(String(logFile.Name));
url += '&api_key=' + encodeURIComponent(api.accessToken);
return url;
return api.getUri('/System/Logs/Log', {
name: logFile.Name,
api_key: api.accessToken
});
};
const getDate = (logFile: LogFile) => {

View file

@ -35,7 +35,6 @@ import Page from 'components/Page';
import { useApi } from 'hooks/useApi';
import globalize from 'lib/globalize';
import { getPluginUrl } from 'utils/dashboard';
import { getUri } from 'utils/api';
interface AlertMessage {
severity?: 'success' | 'info' | 'warning' | 'error'
@ -104,7 +103,7 @@ const PluginPage: FC = () => {
let imageUrl;
if (pluginInfo?.HasImage) {
imageUrl = getUri(`/Plugins/${pluginInfo.Id}/${pluginInfo.Version}/Image`, api);
imageUrl = api?.getUri(`/Plugins/${pluginInfo.Id}/${pluginInfo.Version}/Image`);
}
return {