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

89 lines
2.9 KiB
JavaScript
Raw Normal View History

2020-04-03 03:20:06 +09:00
2020-07-19 16:15:11 +02:00
/* eslint-disable indent */
2020-04-03 03:16:06 +09:00
export function getDeviceIcon(device) {
2020-10-07 21:12:14 +09:00
const baseUrl = 'assets/img/devices/';
switch (device.AppName || device.Client) {
2020-05-04 12:44:12 +02:00
case 'Samsung Smart TV':
return baseUrl + 'samsung.svg';
case 'Xbox One':
return baseUrl + 'xbox.svg';
case 'Sony PS4':
return baseUrl + 'playstation.svg';
case 'Kodi':
return baseUrl + 'kodi.svg';
case 'Jellyfin Android':
2021-07-09 09:40:08 -04:00
case 'AndroidTV':
2020-05-04 12:44:12 +02:00
case 'Android TV':
return baseUrl + 'android.svg';
2022-01-04 11:13:57 -05:00
case 'Jellyfin Mobile (iOS)':
return baseUrl + 'apple.svg';
2020-05-04 12:44:12 +02:00
case 'Jellyfin Web':
switch (device.Name || device.DeviceName) {
2020-05-04 12:44:12 +02:00
case 'Opera':
case 'Opera TV':
case 'Opera Android':
return baseUrl + 'opera.svg';
case 'Chrome':
case 'Chrome Android':
return baseUrl + 'chrome.svg';
case 'Firefox':
case 'Firefox Android':
return baseUrl + 'firefox.svg';
case 'Safari':
case 'Safari iPad':
case 'Safari iPhone':
return baseUrl + 'safari.svg';
2020-07-27 21:11:12 +08:00
case 'Edge Chromium':
case 'Edge Chromium Android':
case 'Edge Chromium iPad':
case 'Edge Chromium iPhone':
return baseUrl + 'edgechromium.svg';
2020-05-04 12:44:12 +02:00
case 'Edge':
return baseUrl + 'edge.svg';
case 'Internet Explorer':
return baseUrl + 'msie.svg';
default:
2020-05-04 12:44:12 +02:00
return baseUrl + 'html5.svg';
2019-12-20 17:44:38 -05:00
}
default:
2020-05-04 12:44:12 +02:00
return baseUrl + 'other.svg';
}
}
2020-04-03 03:16:06 +09:00
export function getLibraryIcon(library) {
switch (library) {
2020-05-04 12:44:12 +02:00
case 'movies':
return 'video_library';
case 'music':
return 'library_music';
case 'photos':
return 'photo_library';
case 'livetv':
return 'live_tv';
case 'tvshows':
return 'tv';
case 'trailers':
return 'local_movies';
case 'homevideos':
return 'photo_library';
case 'musicvideos':
return 'music_video';
case 'books':
return 'library_books';
case 'channels':
return 'videocam';
case 'playlists':
return 'view_list';
default:
2020-05-04 12:44:12 +02:00
return 'folder';
}
}
2020-04-09 00:36:44 +09:00
/* eslint-enable indent */
export default {
getDeviceIcon: getDeviceIcon,
getLibraryIcon: getLibraryIcon
};