dart_plex 0.1.0
dart_plex: ^0.1.0 copied to clipboard
Dart client for Plex Media Server. Supports authentication, library browsing, playlists, streaming, search and more. Targets macOS, Windows, Linux, iOS and Android.
0.1.0 30-06-2026 #
Deprecated #
PlexClient.fetchBytesis deprecated. UserequestBytesinstead (same thing, and it already handles full URLs).
Breaking #
liveTv.history(),liveTv.subscriptions()andliveTv.cancelSubscription()are gone. They pointed at Plex routes that don't exist, so they always failed. Usesessions.history()for playback history andPlexClient.subscriptionsfor recording rules instead.streaming.directFileUrl()now takes the item's full file key instead of a part id and container. The old form built a URL Plex couldn't serve.server.securityResources()now needs asource; Plex rejects the call without one.server.transientToken()no longer takestypeorscope(Plex only allows one mode) and returns the token string directly.transcoder.imageUrl():chromaSubsamplingis now a number (0 to 3) instead of free text, matching what Plex accepts.devices.setChannelMap(): channel remapping actually works now. The mapping and enabled-channels arguments are sent the way Plex expects.epg.bestLineup()now needs bothdeviceandlineupGroup.epg.lineupChannels()takes a list of lineups instead of one, so you can fetch several at once.- To move an item to the front with
playlists.moveItem(),playQueues.moveItem()orsubscriptions.reorder(), just leaveafterout. It is now optional (passing0never worked). PlexStream.selectednow means only "the user picked this stream". The separate "file default" flag is its ownPlexStream.isDefaultfield.PlexHubgained akeyfield for fetching its content;hubKeyis documented as the optional re-fetch key.subscriptions.create():typeis now a number, matching what Plex expects.notifications.connectWebSocket()now returns aFutureand waits for the connection to open before returning.isWebSocketConnectedis onlytrueonce the socket is really open, and a failed connection throws straight away instead of showing up later on the stream.
Added #
library.editItem(),library.deleteMetadataItem(),library.setItemArtwork()andlibrary.updateSectionItems(): edit an item's fields, delete an item, set custom artwork, and bulk-edit many items at once.hubs.forMetadata(): the related rows for one item (e.g. "More from this artist").sessions.historyItem(): fetch a single playback-history entry by id.playlists.upload(): import an m3u playlist from a path on the server.PlexClient.clearSession(): drop the token but stay connected to the server.
Changed #
collections.create()can now make empty, named, typed and smart collections (the seed item is optional, with a newsmartflag).playQueues.create()gained akeyto pick the starting item and turn on shuffle.search.voice()gained atypefilter to limit a voice search to one kind of media.streaming.decisionUniversal()gainedtranscodeTypeso it works for video, audio and photo.PlexCredentialsnow accepts the optionalX-Plex-Model,X-Plex-Device-VendorandX-Plex-Marketplaceidentity headers.- You can pass a
CancelTokentorequest()andrequestBytes()to cancel a request that is still running; a cancelled request now reportsPlexErrorType.cancelledinstead of a genericunknown. PlexExceptionnow keeps the original stack trace, so crash reports point at where the failure actually happened.
Fixed #
- Library settings passed to
addSection()andeditSection()are now actually applied. Before, they were sent in a form Plex ignored, so a new or edited library quietly kept its defaults. - The transcode decision is read correctly now: a successful decision counts as playable (direct play or transcode) and error codes count as errors, so
isPlayable,isDirectandisTranscodeno longer mistake an error for "needs transcoding". playlists.generators()reads the right field, so it no longer always comes back empty.preferences.byId()returns the setting itself, in the same shape as the entries fromall(), instead of the raw response wrapper.sessions.history()date filters now include the start and end dates you pass, instead of dropping items that land exactly on them.transcoder.imageUrl(),subtitlesUrl()andstartUrl()now throw a clear error when called before connecting, instead of returning a broken URL.subscriptions.editPreferences()now sends recording settings in the form Plex expects, so edits take effect.- A response body that can't be decoded is now reported as a
parseerror instead of a genericunknown. PlexResource.providesreturns an empty list (not a list holding one empty string) when a resource advertises nothing, and trims stray spaces.PlexMetadataType.photoAlbumnow uses the exact value Plex sends.
0.0.1 25-05-2026 #
Added #
- Initial scaffold targeting Plex Media Server
v1.43.x. - Authentication flows: legacy username and password, and the official PIN link.
- PMS HTTP client with
X-Plex-*header injection (client identifier, product, version, device, platform, token). - Exception hierarchy with semantic error classification (
auth,notFound,serverError,parse,state,connection,timeout,badRequest,unknown). - Music endpoints: libraries, sections, items by type, playlists, artwork, audio streaming (universal transcode + direct), playback reporting, search, favorites.
- Play queue lifecycle with the new
PlexPlayQueueDTO surfacing the server-assigned queue id, selected item id, shuffle and version state, and initial contents. - Notifications transport over both WebSocket (
/:/websockets/notifications) and Server-Sent Events (/:/eventsource/notifications). - Typed DTOs across the documented API surface, plus a
rawescape hatch on every model for fields not yet promoted.
