@francofantomius/jellyfin 0.4.1 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1938,4 +1938,5 @@ declare class JellyfinAuthError extends JellyfinApiError {
1938
1938
  constructor(message?: string, status?: number, endpoint?: string);
1939
1939
  }
1940
1940
 
1941
- export { AUDIO_QUALITY_PRESETS, type ArtworkUrlOptions, type AudioHlsStreamOptions, type AudioQualityOption, type AudioQualityPresetKey, type AudioStreamOptions, AuthModule, type AuthenticationResult, type BaseItemDto, COMMON_SEARCH_FIELDS, type CacheAdapter, type CacheRecord, type ChapterImageOptions, type ChapterInfoDto, ChaptersModule, type ClientCapabilities, type ClientEventListener, type ClientEventType, type ClientInfo, CollectionsModule, type CreateCollectionOptions, type CreatePlaylistDto, type CreatePlaylistOptions, type DisplayPreferencesDto, DisplayPreferencesModule, type DownloadItemOptions, type DownloadProgress, type DownloadRecord, type DownloadUrlOptions, FavoritesModule, type GeneralCommandDto, type GeneralCommandType, GenresModule, type GetAlbumsOptions, type GetArtistsOptions, type GetCollectionItemsOptions, type GetCollectionsOptions, type GetDisplayPreferencesOptions, type GetEpisodesOptions, type GetGenresOptions, type GetLatestMediaOptions, type GetMediaSegmentsOptions, type GetMoviesOptions, type GetNextUpOptions, type GetResumeItemsOptions, type GetSeasonsOptions, type GetSeriesOptions, type GetSessionsOptions, type GetSongsOptions, type GetStudiosOptions, type GetVideosOptions, HttpTransport, IndexedDBCacheAdapter, type IntroCreditsMarkers, type ItemsResponse, JellyfinApiError, JellyfinAuthError, JellyfinClient, type JellyfinClientOptions, JellyfinError, LatestModule, type LibraryChangedData, LibraryModule, LocalStorageAdapter, type LyricLine, type LyricsDto, LyricsModule, type MarkerRange, MediaModule, type MediaSegmentDto, type MediaSegmentType, type MediaSourceInfo, type MediaStreamInfo, MemoryCacheAdapter, MemoryStorage, NextUpModule, OfflineStorageManager, type PlayCommandType, type PlaybackInfoOptions, type PlaybackInfoResponse, PlaybackModule, PlaylistsModule, type PlaystateCommand, type PublicSystemInfo, QuickConnectModule, type QuickConnectPollOptions, type QuickConnectResult, type QuickConnectState, type RemotePlayOptions, type RequestOptions, ResumeModule, SearchModule, type SearchOptions, type SessionInfoDto, type SessionMessageOptions, type SessionPlayState, SessionsModule, type StopActiveEncodingOptions, type StorageAdapter, type SubtitleTrackInfo, type SubtitleUrlOptions, type SystemInfo, SystemModule, type ThumbnailLookupOptions, type ThumbnailLookupResult, TranscodeModule, type TrickplayInfoDto, type TrickplayManifestInfo, type TrickplayManifestTile, TrickplayModule, type TrickplayStreamOptions, type UpdateDisplayPreferencesOptions, type UpdatePlaylistOptions, type UserDataChangedData, type UserDto, type UserItemDataDto, VIDEO_QUALITY_PRESETS, type VideoHlsStreamOptions, type VideoQualityOption, type VideoQualityPresetKey, type VideoStreamOptions, type WebSocketEventListener, type WebSocketInboundMessage, type WebSocketMessageType, WebSocketModule, type WebSocketModuleOptions, buildAuthHeader, cleanUrl, fetchWithCache, formatBitrate, generateDeviceId, getAudioQualityList, getDefaultStorage, getVideoQualityList, isV12OrHigher, isVersionAtLeast, parseSemVer, resolveAudioQuality, resolveVideoQuality };
1941
+ export { AUDIO_QUALITY_PRESETS, AuthModule, COMMON_SEARCH_FIELDS, ChaptersModule, CollectionsModule, DisplayPreferencesModule, FavoritesModule, GenresModule, HttpTransport, IndexedDBCacheAdapter, JellyfinApiError, JellyfinAuthError, JellyfinClient, JellyfinError, LatestModule, LibraryModule, LocalStorageAdapter, LyricsModule, MediaModule, MemoryCacheAdapter, MemoryStorage, NextUpModule, OfflineStorageManager, PlaybackModule, PlaylistsModule, QuickConnectModule, ResumeModule, SearchModule, SessionsModule, SystemModule, TranscodeModule, TrickplayModule, VIDEO_QUALITY_PRESETS, WebSocketModule, buildAuthHeader, cleanUrl, fetchWithCache, formatBitrate, generateDeviceId, getAudioQualityList, getDefaultStorage, getVideoQualityList, isV12OrHigher, isVersionAtLeast, parseSemVer, resolveAudioQuality, resolveVideoQuality };
1942
+ export type { ArtworkUrlOptions, AudioHlsStreamOptions, AudioQualityOption, AudioQualityPresetKey, AudioStreamOptions, AuthenticationResult, BaseItemDto, CacheAdapter, CacheRecord, ChapterImageOptions, ChapterInfoDto, ClientCapabilities, ClientEventListener, ClientEventType, ClientInfo, CreateCollectionOptions, CreatePlaylistDto, CreatePlaylistOptions, DisplayPreferencesDto, DownloadItemOptions, DownloadProgress, DownloadRecord, DownloadUrlOptions, GeneralCommandDto, GeneralCommandType, GetAlbumsOptions, GetArtistsOptions, GetCollectionItemsOptions, GetCollectionsOptions, GetDisplayPreferencesOptions, GetEpisodesOptions, GetGenresOptions, GetLatestMediaOptions, GetMediaSegmentsOptions, GetMoviesOptions, GetNextUpOptions, GetResumeItemsOptions, GetSeasonsOptions, GetSeriesOptions, GetSessionsOptions, GetSongsOptions, GetStudiosOptions, GetVideosOptions, IntroCreditsMarkers, ItemsResponse, JellyfinClientOptions, LibraryChangedData, LyricLine, LyricsDto, MarkerRange, MediaSegmentDto, MediaSegmentType, MediaSourceInfo, MediaStreamInfo, PlayCommandType, PlaybackInfoOptions, PlaybackInfoResponse, PlaystateCommand, PublicSystemInfo, QuickConnectPollOptions, QuickConnectResult, QuickConnectState, RemotePlayOptions, RequestOptions, SearchOptions, SessionInfoDto, SessionMessageOptions, SessionPlayState, StopActiveEncodingOptions, StorageAdapter, SubtitleTrackInfo, SubtitleUrlOptions, SystemInfo, ThumbnailLookupOptions, ThumbnailLookupResult, TrickplayInfoDto, TrickplayManifestInfo, TrickplayManifestTile, TrickplayStreamOptions, UpdateDisplayPreferencesOptions, UpdatePlaylistOptions, UserDataChangedData, UserDto, UserItemDataDto, VideoHlsStreamOptions, VideoQualityOption, VideoQualityPresetKey, VideoStreamOptions, WebSocketEventListener, WebSocketInboundMessage, WebSocketMessageType, WebSocketModuleOptions };
package/dist/index.d.ts CHANGED
@@ -1938,4 +1938,5 @@ declare class JellyfinAuthError extends JellyfinApiError {
1938
1938
  constructor(message?: string, status?: number, endpoint?: string);
1939
1939
  }
1940
1940
 
1941
- export { AUDIO_QUALITY_PRESETS, type ArtworkUrlOptions, type AudioHlsStreamOptions, type AudioQualityOption, type AudioQualityPresetKey, type AudioStreamOptions, AuthModule, type AuthenticationResult, type BaseItemDto, COMMON_SEARCH_FIELDS, type CacheAdapter, type CacheRecord, type ChapterImageOptions, type ChapterInfoDto, ChaptersModule, type ClientCapabilities, type ClientEventListener, type ClientEventType, type ClientInfo, CollectionsModule, type CreateCollectionOptions, type CreatePlaylistDto, type CreatePlaylistOptions, type DisplayPreferencesDto, DisplayPreferencesModule, type DownloadItemOptions, type DownloadProgress, type DownloadRecord, type DownloadUrlOptions, FavoritesModule, type GeneralCommandDto, type GeneralCommandType, GenresModule, type GetAlbumsOptions, type GetArtistsOptions, type GetCollectionItemsOptions, type GetCollectionsOptions, type GetDisplayPreferencesOptions, type GetEpisodesOptions, type GetGenresOptions, type GetLatestMediaOptions, type GetMediaSegmentsOptions, type GetMoviesOptions, type GetNextUpOptions, type GetResumeItemsOptions, type GetSeasonsOptions, type GetSeriesOptions, type GetSessionsOptions, type GetSongsOptions, type GetStudiosOptions, type GetVideosOptions, HttpTransport, IndexedDBCacheAdapter, type IntroCreditsMarkers, type ItemsResponse, JellyfinApiError, JellyfinAuthError, JellyfinClient, type JellyfinClientOptions, JellyfinError, LatestModule, type LibraryChangedData, LibraryModule, LocalStorageAdapter, type LyricLine, type LyricsDto, LyricsModule, type MarkerRange, MediaModule, type MediaSegmentDto, type MediaSegmentType, type MediaSourceInfo, type MediaStreamInfo, MemoryCacheAdapter, MemoryStorage, NextUpModule, OfflineStorageManager, type PlayCommandType, type PlaybackInfoOptions, type PlaybackInfoResponse, PlaybackModule, PlaylistsModule, type PlaystateCommand, type PublicSystemInfo, QuickConnectModule, type QuickConnectPollOptions, type QuickConnectResult, type QuickConnectState, type RemotePlayOptions, type RequestOptions, ResumeModule, SearchModule, type SearchOptions, type SessionInfoDto, type SessionMessageOptions, type SessionPlayState, SessionsModule, type StopActiveEncodingOptions, type StorageAdapter, type SubtitleTrackInfo, type SubtitleUrlOptions, type SystemInfo, SystemModule, type ThumbnailLookupOptions, type ThumbnailLookupResult, TranscodeModule, type TrickplayInfoDto, type TrickplayManifestInfo, type TrickplayManifestTile, TrickplayModule, type TrickplayStreamOptions, type UpdateDisplayPreferencesOptions, type UpdatePlaylistOptions, type UserDataChangedData, type UserDto, type UserItemDataDto, VIDEO_QUALITY_PRESETS, type VideoHlsStreamOptions, type VideoQualityOption, type VideoQualityPresetKey, type VideoStreamOptions, type WebSocketEventListener, type WebSocketInboundMessage, type WebSocketMessageType, WebSocketModule, type WebSocketModuleOptions, buildAuthHeader, cleanUrl, fetchWithCache, formatBitrate, generateDeviceId, getAudioQualityList, getDefaultStorage, getVideoQualityList, isV12OrHigher, isVersionAtLeast, parseSemVer, resolveAudioQuality, resolveVideoQuality };
1941
+ export { AUDIO_QUALITY_PRESETS, AuthModule, COMMON_SEARCH_FIELDS, ChaptersModule, CollectionsModule, DisplayPreferencesModule, FavoritesModule, GenresModule, HttpTransport, IndexedDBCacheAdapter, JellyfinApiError, JellyfinAuthError, JellyfinClient, JellyfinError, LatestModule, LibraryModule, LocalStorageAdapter, LyricsModule, MediaModule, MemoryCacheAdapter, MemoryStorage, NextUpModule, OfflineStorageManager, PlaybackModule, PlaylistsModule, QuickConnectModule, ResumeModule, SearchModule, SessionsModule, SystemModule, TranscodeModule, TrickplayModule, VIDEO_QUALITY_PRESETS, WebSocketModule, buildAuthHeader, cleanUrl, fetchWithCache, formatBitrate, generateDeviceId, getAudioQualityList, getDefaultStorage, getVideoQualityList, isV12OrHigher, isVersionAtLeast, parseSemVer, resolveAudioQuality, resolveVideoQuality };
1942
+ export type { ArtworkUrlOptions, AudioHlsStreamOptions, AudioQualityOption, AudioQualityPresetKey, AudioStreamOptions, AuthenticationResult, BaseItemDto, CacheAdapter, CacheRecord, ChapterImageOptions, ChapterInfoDto, ClientCapabilities, ClientEventListener, ClientEventType, ClientInfo, CreateCollectionOptions, CreatePlaylistDto, CreatePlaylistOptions, DisplayPreferencesDto, DownloadItemOptions, DownloadProgress, DownloadRecord, DownloadUrlOptions, GeneralCommandDto, GeneralCommandType, GetAlbumsOptions, GetArtistsOptions, GetCollectionItemsOptions, GetCollectionsOptions, GetDisplayPreferencesOptions, GetEpisodesOptions, GetGenresOptions, GetLatestMediaOptions, GetMediaSegmentsOptions, GetMoviesOptions, GetNextUpOptions, GetResumeItemsOptions, GetSeasonsOptions, GetSeriesOptions, GetSessionsOptions, GetSongsOptions, GetStudiosOptions, GetVideosOptions, IntroCreditsMarkers, ItemsResponse, JellyfinClientOptions, LibraryChangedData, LyricLine, LyricsDto, MarkerRange, MediaSegmentDto, MediaSegmentType, MediaSourceInfo, MediaStreamInfo, PlayCommandType, PlaybackInfoOptions, PlaybackInfoResponse, PlaystateCommand, PublicSystemInfo, QuickConnectPollOptions, QuickConnectResult, QuickConnectState, RemotePlayOptions, RequestOptions, SearchOptions, SessionInfoDto, SessionMessageOptions, SessionPlayState, StopActiveEncodingOptions, StorageAdapter, SubtitleTrackInfo, SubtitleUrlOptions, SystemInfo, ThumbnailLookupOptions, ThumbnailLookupResult, TrickplayInfoDto, TrickplayManifestInfo, TrickplayManifestTile, TrickplayStreamOptions, UpdateDisplayPreferencesOptions, UpdatePlaylistOptions, UserDataChangedData, UserDto, UserItemDataDto, VideoHlsStreamOptions, VideoQualityOption, VideoQualityPresetKey, VideoStreamOptions, WebSocketEventListener, WebSocketInboundMessage, WebSocketMessageType, WebSocketModuleOptions };
package/dist/index.js CHANGED
@@ -25,7 +25,10 @@ var JellyfinAuthError = class extends JellyfinApiError {
25
25
  // src/http.ts
26
26
  function cleanUrl(url) {
27
27
  if (!url) return "";
28
- let cleaned = url.trim().replace(/\/+$/, "");
28
+ let cleaned = url.trim();
29
+ while (cleaned.endsWith("/")) {
30
+ cleaned = cleaned.slice(0, -1);
31
+ }
29
32
  if (!/^https?:\/\//i.test(cleaned)) {
30
33
  cleaned = "https://" + cleaned;
31
34
  }
@@ -1675,7 +1678,7 @@ var OfflineStorageManager = class {
1675
1678
  request.onerror = () => resolve(null);
1676
1679
  });
1677
1680
  } catch (err) {
1678
- console.warn(`[Jellyfin Offline] getDownloadedRecord error for ${id}:`, err);
1681
+ console.warn("[Jellyfin Offline] getDownloadedRecord error for %s:", id, err);
1679
1682
  return null;
1680
1683
  }
1681
1684
  }
@@ -2430,7 +2433,7 @@ var WebSocketModule = class {
2430
2433
  try {
2431
2434
  listener(...args);
2432
2435
  } catch (e) {
2433
- console.error(`[Jellyfin SDK] WebSocket listener error on '${event}':`, e);
2436
+ console.error("[Jellyfin SDK] WebSocket listener error on '%s':", event, e);
2434
2437
  }
2435
2438
  });
2436
2439
  }
@@ -3765,7 +3768,7 @@ var JellyfinClient = class {
3765
3768
  this.cache = new MemoryCacheAdapter();
3766
3769
  this.clientInfo = {
3767
3770
  name: options.clientInfo?.name || "@francofantomius/jellyfin",
3768
- version: options.clientInfo?.version || "0.4.1",
3771
+ version: options.clientInfo?.version || "0.4.2",
3769
3772
  device: options.clientInfo?.device || (typeof window !== "undefined" ? "Web Browser" : "Node.js"),
3770
3773
  deviceId: options.clientInfo?.deviceId || generateDeviceId()
3771
3774
  };
@@ -3887,7 +3890,7 @@ var JellyfinClient = class {
3887
3890
  try {
3888
3891
  fn(...args);
3889
3892
  } catch (e) {
3890
- console.error(`[Jellyfin SDK] Event handler error on '${event}':`, e);
3893
+ console.error("[Jellyfin SDK] Event handler error on '%s':", event, e);
3891
3894
  }
3892
3895
  });
3893
3896
  }