mirror of
https://github.com/LukeHagar/plexgo.git
synced 2025-12-06 04:20:46 +00:00
ci: regenerated with OpenAPI Doc 0.0.3, Speakeasy CLI 1.148.0
This commit is contained in:
@@ -26,7 +26,6 @@ import(
|
||||
"github.com/LukeHagar/plexgo/models/operations"
|
||||
"context"
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -45,7 +44,7 @@ func main() {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if res.StatusCode == http.StatusOK {
|
||||
if res.Object != nil {
|
||||
// handle response
|
||||
}
|
||||
}
|
||||
@@ -84,7 +83,6 @@ import(
|
||||
"github.com/LukeHagar/plexgo/models/operations"
|
||||
"context"
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -105,7 +103,7 @@ func main() {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if res.StatusCode == http.StatusOK {
|
||||
if res.Object != nil {
|
||||
// handle response
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,8 +15,6 @@ API Calls interacting with Plex Media Server Libraries
|
||||
* [DeleteLibrary](#deletelibrary) - Delete Library Section
|
||||
* [GetLibraryItems](#getlibraryitems) - Get Library Items
|
||||
* [RefreshLibrary](#refreshlibrary) - Refresh Library
|
||||
* [GetLatestLibraryItems](#getlatestlibraryitems) - Get Latest Library Items
|
||||
* [GetCommonLibraryItems](#getcommonlibraryitems) - Get Common Library Items
|
||||
* [GetMetadata](#getmetadata) - Get Items Metadata
|
||||
* [GetMetadataChildren](#getmetadatachildren) - Get Items Children
|
||||
* [GetOnDeck](#getondeck) - Get On Deck
|
||||
@@ -182,25 +180,45 @@ func main() {
|
||||
|
||||
## GetLibrary
|
||||
|
||||
Returns details for the library. This can be thought of as an interstitial endpoint because it contains information about the library, rather than content itself. These details are:
|
||||
## Library Details Endpoint
|
||||
|
||||
- A list of `Directory` objects: These used to be used by clients to build a menuing system. There are four flavors of directory found here:
|
||||
- Primary: (e.g. all, On Deck) These are still used in some clients to provide "shortcuts" to subsets of media. However, with the exception of On Deck, all of them can be created by media queries, and the desire is to allow these to be customized by users.
|
||||
- Secondary: These are marked with `secondary="1"` and were used by old clients to provide nested menus allowing for primative (but structured) navigation.
|
||||
- Special: There is a By Folder entry which allows browsing the media by the underlying filesystem structure, and there's a completely obsolete entry marked `search="1"` which used to be used to allow clients to build search dialogs on the fly.
|
||||
- A list of `Type` objects: These represent the types of things found in this library, and for each one, a list of `Filter` and `Sort` objects. These can be used to build rich controls around a grid of media to allow filtering and organizing. Note that these filters and sorts are optional, and without them, the client won't render any filtering controls. The `Type` object contains:
|
||||
- `key`: This provides the root endpoint returning the actual media list for the type.
|
||||
- `type`: This is the metadata type for the type (if a standard Plex type).
|
||||
- `title`: The title for for the content of this type (e.g. "Movies").
|
||||
- Each `Filter` object contains a description of the filter. Note that it is not an exhaustive list of the full media query language, but an inportant subset useful for top-level API.
|
||||
- `filter`: This represents the filter name used for the filter, which can be used to construct complex media queries with.
|
||||
- `filterType`: This is either `string`, `integer`, or `boolean`, and describes the type of values used for the filter.
|
||||
- `key`: This provides the endpoint where the possible range of values for the filter can be retrieved (e.g. for a "Genre" filter, it returns a list of all the genres in the library). This will include a `type` argument that matches the metadata type of the Type element.
|
||||
- `title`: The title for the filter.
|
||||
- Each `Sort` object contains a description of the sort field.
|
||||
- `defaultDirection`: Can be either `asc` or `desc`, and specifies the default direction for the sort field (e.g. titles default to alphabetically ascending).
|
||||
- `descKey` and `key`: Contains the parameters passed to the `sort=...` media query for each direction of the sort.
|
||||
- `title`: The title of the field.
|
||||
This endpoint provides comprehensive details about the library, focusing on organizational aspects rather than the content itself.
|
||||
|
||||
The details include:
|
||||
|
||||
### Directories
|
||||
Organized into three categories:
|
||||
|
||||
- **Primary Directories**:
|
||||
- Used in some clients for quick access to media subsets (e.g., "All", "On Deck").
|
||||
- Most can be replicated via media queries.
|
||||
- Customizable by users.
|
||||
|
||||
- **Secondary Directories**:
|
||||
- Marked with `secondary="1"`.
|
||||
- Used in older clients for structured navigation.
|
||||
|
||||
- **Special Directories**:
|
||||
- Includes a "By Folder" entry for filesystem-based browsing.
|
||||
- Contains an obsolete `search="1"` entry for on-the-fly search dialog creation.
|
||||
|
||||
### Types
|
||||
Each type in the library comes with a set of filters and sorts, aiding in building dynamic media controls:
|
||||
|
||||
- **Type Object Attributes**:
|
||||
- `key`: Endpoint for the media list of this type.
|
||||
- `type`: Metadata type (if standard Plex type).
|
||||
- `title`: Title for this content type (e.g., "Movies").
|
||||
|
||||
- **Filter Objects**:
|
||||
- Subset of the media query language.
|
||||
- Attributes include `filter` (name), `filterType` (data type), `key` (endpoint for value range), and `title`.
|
||||
|
||||
- **Sort Objects**:
|
||||
- Description of sort fields.
|
||||
- Attributes include `defaultDirection` (asc/desc), `descKey` and `key` (sort parameters), and `title`.
|
||||
|
||||
> **Note**: Filters and sorts are optional; without them, no filtering controls are rendered.
|
||||
|
||||
|
||||
### Example Usage
|
||||
@@ -310,7 +328,27 @@ func main() {
|
||||
|
||||
## GetLibraryItems
|
||||
|
||||
This endpoint will return a list of library items filtered by the filter and type provided
|
||||
Fetches details from a specific section of the library identified by a section key and a tag. The tag parameter accepts the following values:
|
||||
- `all`: All items in the section.
|
||||
- `unwatched`: Items that have not been played.
|
||||
- `newest`: Items that are recently released.
|
||||
- `recentlyAdded`: Items that are recently added to the library.
|
||||
- `recentlyViewed`: Items that were recently viewed.
|
||||
- `onDeck`: Items to continue watching.
|
||||
- `collection`: Items categorized by collection.
|
||||
- `edition`: Items categorized by edition.
|
||||
- `genre`: Items categorized by genre.
|
||||
- `year`: Items categorized by year of release.
|
||||
- `decade`: Items categorized by decade.
|
||||
- `director`: Items categorized by director.
|
||||
- `actor`: Items categorized by starring actor.
|
||||
- `country`: Items categorized by country of origin.
|
||||
- `contentRating`: Items categorized by content rating.
|
||||
- `rating`: Items categorized by rating.
|
||||
- `resolution`: Items categorized by resolution.
|
||||
- `firstCharacter`: Items categorized by the first letter.
|
||||
- `folder`: Items categorized by folder.
|
||||
- `search?type=1`: Search functionality within the section.
|
||||
|
||||
|
||||
### Example Usage
|
||||
@@ -321,9 +359,9 @@ package main
|
||||
import(
|
||||
"github.com/LukeHagar/plexgo/models/components"
|
||||
"github.com/LukeHagar/plexgo"
|
||||
"github.com/LukeHagar/plexgo/models/operations"
|
||||
"context"
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -332,19 +370,17 @@ func main() {
|
||||
)
|
||||
|
||||
|
||||
var sectionID float64 = 4510.92
|
||||
var sectionID int64 = 451092
|
||||
|
||||
var type_ *float64 = 760.66
|
||||
|
||||
var filter *string = "string"
|
||||
var tag operations.Tag = operations.TagUnwatched
|
||||
|
||||
ctx := context.Background()
|
||||
res, err := s.Library.GetLibraryItems(ctx, sectionID, type_, filter)
|
||||
res, err := s.Library.GetLibraryItems(ctx, sectionID, tag)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if res.StatusCode == http.StatusOK {
|
||||
if res.Object != nil {
|
||||
// handle response
|
||||
}
|
||||
}
|
||||
@@ -355,18 +391,16 @@ func main() {
|
||||
| Parameter | Type | Required | Description |
|
||||
| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- |
|
||||
| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. |
|
||||
| `sectionID` | *float64* | :heavy_check_mark: | the Id of the library to query |
|
||||
| `type_` | **float64* | :heavy_minus_sign: | item type |
|
||||
| `filter` | **string* | :heavy_minus_sign: | the filter parameter |
|
||||
| `sectionID` | *int64* | :heavy_check_mark: | the Id of the library to query |
|
||||
| `tag` | [operations.Tag](../../models/operations/tag.md) | :heavy_check_mark: | A key representing a specific tag within the section. |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[*operations.GetLibraryItemsResponse](../../models/operations/getlibraryitemsresponse.md), error**
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ------------------------------------- | ------------------------------------- | ------------------------------------- |
|
||||
| sdkerrors.GetLibraryItemsResponseBody | 401 | application/json |
|
||||
| sdkerrors.SDKError | 4xx-5xx | */* |
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ------------------ | ------------------ | ------------------ |
|
||||
| sdkerrors.SDKError | 4xx-5xx | */* |
|
||||
|
||||
## RefreshLibrary
|
||||
|
||||
@@ -422,126 +456,6 @@ func main() {
|
||||
| sdkerrors.RefreshLibraryResponseBody | 401 | application/json |
|
||||
| sdkerrors.SDKError | 4xx-5xx | */* |
|
||||
|
||||
## GetLatestLibraryItems
|
||||
|
||||
This endpoint will return a list of the latest library items filtered by the filter and type provided
|
||||
|
||||
|
||||
### Example Usage
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import(
|
||||
"github.com/LukeHagar/plexgo/models/components"
|
||||
"github.com/LukeHagar/plexgo"
|
||||
"context"
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func main() {
|
||||
s := plexgo.New(
|
||||
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||
)
|
||||
|
||||
|
||||
var sectionID float64 = 7171.54
|
||||
|
||||
var type_ float64 = 8015.12
|
||||
|
||||
var filter *string = "string"
|
||||
|
||||
ctx := context.Background()
|
||||
res, err := s.Library.GetLatestLibraryItems(ctx, sectionID, type_, filter)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if res.StatusCode == http.StatusOK {
|
||||
// handle response
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- |
|
||||
| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. |
|
||||
| `sectionID` | *float64* | :heavy_check_mark: | the Id of the library to query |
|
||||
| `type_` | *float64* | :heavy_check_mark: | item type |
|
||||
| `filter` | **string* | :heavy_minus_sign: | the filter parameter |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[*operations.GetLatestLibraryItemsResponse](../../models/operations/getlatestlibraryitemsresponse.md), error**
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- |
|
||||
| sdkerrors.GetLatestLibraryItemsResponseBody | 401 | application/json |
|
||||
| sdkerrors.SDKError | 4xx-5xx | */* |
|
||||
|
||||
## GetCommonLibraryItems
|
||||
|
||||
Represents a "Common" item. It contains only the common attributes of the items selected by the provided filter
|
||||
|
||||
|
||||
### Example Usage
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import(
|
||||
"github.com/LukeHagar/plexgo/models/components"
|
||||
"github.com/LukeHagar/plexgo"
|
||||
"context"
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func main() {
|
||||
s := plexgo.New(
|
||||
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
||||
)
|
||||
|
||||
|
||||
var sectionID float64 = 2710.37
|
||||
|
||||
var type_ float64 = 2760.31
|
||||
|
||||
var filter *string = "string"
|
||||
|
||||
ctx := context.Background()
|
||||
res, err := s.Library.GetCommonLibraryItems(ctx, sectionID, type_, filter)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if res.StatusCode == http.StatusOK {
|
||||
// handle response
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- |
|
||||
| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. |
|
||||
| `sectionID` | *float64* | :heavy_check_mark: | the Id of the library to query |
|
||||
| `type_` | *float64* | :heavy_check_mark: | item type |
|
||||
| `filter` | **string* | :heavy_minus_sign: | the filter parameter |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**[*operations.GetCommonLibraryItemsResponse](../../models/operations/getcommonlibraryitemsresponse.md), error**
|
||||
| Error Object | Status Code | Content Type |
|
||||
| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- |
|
||||
| sdkerrors.GetCommonLibraryItemsResponseBody | 401 | application/json |
|
||||
| sdkerrors.SDKError | 4xx-5xx | */* |
|
||||
|
||||
## GetMetadata
|
||||
|
||||
This endpoint will return the metadata of a library item specified with the ratingKey.
|
||||
@@ -557,7 +471,6 @@ import(
|
||||
"github.com/LukeHagar/plexgo"
|
||||
"context"
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -574,7 +487,7 @@ func main() {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if res.StatusCode == http.StatusOK {
|
||||
if res.Object != nil {
|
||||
// handle response
|
||||
}
|
||||
}
|
||||
@@ -611,7 +524,6 @@ import(
|
||||
"github.com/LukeHagar/plexgo"
|
||||
"context"
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -628,7 +540,7 @@ func main() {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if res.StatusCode == http.StatusOK {
|
||||
if res.Object != nil {
|
||||
// handle response
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,9 +39,9 @@ func main() {
|
||||
|
||||
var level operations.Level = operations.LevelThree
|
||||
|
||||
var message string = "string"
|
||||
var message string = "Test log message"
|
||||
|
||||
var source string = "string"
|
||||
var source string = "Postman"
|
||||
|
||||
ctx := context.Background()
|
||||
res, err := s.Log.LogLine(ctx, level, message, source)
|
||||
@@ -57,12 +57,12 @@ func main() {
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |
|
||||
| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | |
|
||||
| `level` | [operations.Level](../../models/operations/level.md) | :heavy_check_mark: | An integer log level to write to the PMS log with. <br/>0: Error <br/>1: Warning <br/>2: Info <br/>3: Debug <br/>4: Verbose<br/> | |
|
||||
| `message` | *string* | :heavy_check_mark: | The text of the message to write to the log. | |
|
||||
| `source` | *string* | :heavy_check_mark: | a string indicating the source of the message. | |
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
|
||||
| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | |
|
||||
| `level` | [operations.Level](../../models/operations/level.md) | :heavy_check_mark: | An integer log level to write to the PMS log with. <br/>0: Error <br/>1: Warning <br/>2: Info <br/>3: Debug <br/>4: Verbose<br/> | |
|
||||
| `message` | *string* | :heavy_check_mark: | The text of the message to write to the log. | Test log message |
|
||||
| `source` | *string* | :heavy_check_mark: | a string indicating the source of the message. | Postman |
|
||||
|
||||
|
||||
### Response
|
||||
@@ -75,7 +75,27 @@ func main() {
|
||||
|
||||
## LogMultiLine
|
||||
|
||||
This endpoint will write multiple lines to the main Plex Media Server log in a single request. It takes a set of query strings as would normally sent to the above GET endpoint as a linefeed-separated block of POST data. The parameters for each query string match as above.
|
||||
This endpoint allows for the batch addition of log entries to the main Plex Media Server log.
|
||||
It accepts a text/plain request body, where each line represents a distinct log entry.
|
||||
Each log entry consists of URL-encoded key-value pairs, specifying log attributes such as 'level', 'message', and 'source'.
|
||||
|
||||
Log entries are separated by a newline character (`\n`).
|
||||
Each entry's parameters should be URL-encoded to ensure accurate parsing and handling of special characters.
|
||||
This method is efficient for logging multiple entries in a single API call, reducing the overhead of multiple individual requests.
|
||||
|
||||
The 'level' parameter specifies the log entry's severity or importance, with the following integer values:
|
||||
- `0`: Error - Critical issues that require immediate attention.
|
||||
- `1`: Warning - Important events that are not critical but may indicate potential issues.
|
||||
- `2`: Info - General informational messages about system operation.
|
||||
- `3`: Debug - Detailed information useful for debugging purposes.
|
||||
- `4`: Verbose - Highly detailed diagnostic information for in-depth analysis.
|
||||
|
||||
The 'message' parameter contains the log text, and 'source' identifies the log message's origin (e.g., an application name or module).
|
||||
|
||||
Example of a single log entry format:
|
||||
`level=4&message=Sample%20log%20entry&source=applicationName`
|
||||
|
||||
Ensure each parameter is properly URL-encoded to avoid interpretation issues.
|
||||
|
||||
|
||||
### Example Usage
|
||||
@@ -97,7 +117,9 @@ func main() {
|
||||
)
|
||||
|
||||
ctx := context.Background()
|
||||
res, err := s.Log.LogMultiLine(ctx)
|
||||
res, err := s.Log.LogMultiLine(ctx, "level=4&message=Test%20message%201&source=postman
|
||||
level=3&message=Test%20message%202&source=postman
|
||||
level=1&message=Test%20message%203&source=postman")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
@@ -113,6 +135,7 @@ func main() {
|
||||
| Parameter | Type | Required | Description |
|
||||
| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- |
|
||||
| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. |
|
||||
| `request` | [string](../../.md) | :heavy_check_mark: | The request object to use for the request. |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
@@ -24,7 +24,7 @@ This may cause the duration and number of items to change.
|
||||
## CreatePlaylist
|
||||
|
||||
Create a new playlist. By default the playlist is blank. To create a playlist along with a first item, pass:
|
||||
- `uri` - The content URI for what we're playing (e.g. `library://...`).
|
||||
- `uri` - The content URI for what we're playing (e.g. `server://1234/com.plexapp.plugins.library/library/metadata/1`).
|
||||
- `playQueueID` - To create a playlist from an existing play queue.
|
||||
|
||||
|
||||
@@ -39,7 +39,6 @@ import(
|
||||
"context"
|
||||
"github.com/LukeHagar/plexgo/models/operations"
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -52,12 +51,13 @@ func main() {
|
||||
Title: "string",
|
||||
Type: operations.TypePhoto,
|
||||
Smart: operations.SmartOne,
|
||||
URI: "https://inborn-brochure.biz",
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if res.StatusCode == http.StatusOK {
|
||||
if res.Object != nil {
|
||||
// handle response
|
||||
}
|
||||
}
|
||||
@@ -94,7 +94,6 @@ import(
|
||||
"github.com/LukeHagar/plexgo/models/operations"
|
||||
"context"
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -113,7 +112,7 @@ func main() {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if res.StatusCode == http.StatusOK {
|
||||
if res.Object != nil {
|
||||
// handle response
|
||||
}
|
||||
}
|
||||
@@ -152,7 +151,6 @@ import(
|
||||
"github.com/LukeHagar/plexgo"
|
||||
"context"
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -169,7 +167,7 @@ func main() {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if res.StatusCode == http.StatusOK {
|
||||
if res.Object != nil {
|
||||
// handle response
|
||||
}
|
||||
}
|
||||
@@ -271,8 +269,12 @@ func main() {
|
||||
|
||||
var playlistID float64 = 3915
|
||||
|
||||
var title *string = "string"
|
||||
|
||||
var summary *string = "string"
|
||||
|
||||
ctx := context.Background()
|
||||
res, err := s.Playlists.UpdatePlaylist(ctx, playlistID)
|
||||
res, err := s.Playlists.UpdatePlaylist(ctx, playlistID, title, summary)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
@@ -289,6 +291,8 @@ func main() {
|
||||
| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- |
|
||||
| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. |
|
||||
| `playlistID` | *float64* | :heavy_check_mark: | the ID of the playlist |
|
||||
| `title` | **string* | :heavy_minus_sign: | name of the playlist |
|
||||
| `summary` | **string* | :heavy_minus_sign: | summary description of the playlist |
|
||||
|
||||
|
||||
### Response
|
||||
@@ -317,7 +321,6 @@ import(
|
||||
"github.com/LukeHagar/plexgo"
|
||||
"context"
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -336,7 +339,7 @@ func main() {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if res.StatusCode == http.StatusOK {
|
||||
if res.Object != nil {
|
||||
// handle response
|
||||
}
|
||||
}
|
||||
@@ -415,7 +418,7 @@ func main() {
|
||||
|
||||
## AddPlaylistContents
|
||||
|
||||
Adds a generator to a playlist, same parameters as the POST above. With a dumb playlist, this adds the specified items to the playlist.
|
||||
Adds a generator to a playlist, same parameters as the POST to create. With a dumb playlist, this adds the specified items to the playlist.
|
||||
With a smart playlist, passing a new `uri` parameter replaces the rules for the playlist. Returns the playlist.
|
||||
|
||||
|
||||
@@ -429,7 +432,6 @@ import(
|
||||
"github.com/LukeHagar/plexgo"
|
||||
"context"
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -440,9 +442,9 @@ func main() {
|
||||
|
||||
var playlistID float64 = 8502.01
|
||||
|
||||
var uri string = "library://.."
|
||||
var uri string = "server://12345/com.plexapp.plugins.library/library/metadata/1"
|
||||
|
||||
var playQueueID float64 = 123
|
||||
var playQueueID *float64 = 123
|
||||
|
||||
ctx := context.Background()
|
||||
res, err := s.Playlists.AddPlaylistContents(ctx, playlistID, uri, playQueueID)
|
||||
@@ -450,7 +452,7 @@ func main() {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if res.StatusCode == http.StatusOK {
|
||||
if res.Object != nil {
|
||||
// handle response
|
||||
}
|
||||
}
|
||||
@@ -458,12 +460,12 @@ func main() {
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- |
|
||||
| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | |
|
||||
| `playlistID` | *float64* | :heavy_check_mark: | the ID of the playlist | |
|
||||
| `uri` | *string* | :heavy_check_mark: | the content URI for the playlist | library://.. |
|
||||
| `playQueueID` | *float64* | :heavy_check_mark: | the play queue to add to a playlist | 123 |
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- |
|
||||
| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | |
|
||||
| `playlistID` | *float64* | :heavy_check_mark: | the ID of the playlist | |
|
||||
| `uri` | *string* | :heavy_check_mark: | the content URI for the playlist | server://12345/com.plexapp.plugins.library/library/metadata/1 |
|
||||
| `playQueueID` | **float64* | :heavy_minus_sign: | the play queue to add to a playlist | 123 |
|
||||
|
||||
|
||||
### Response
|
||||
@@ -521,7 +523,7 @@ func main() {
|
||||
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | |
|
||||
| `path` | *string* | :heavy_check_mark: | absolute path to a directory on the server where m3u files are stored, or the absolute path to a playlist file on the server. <br/>If the `path` argument is a directory, that path will be scanned for playlist files to be processed. <br/>Each file in that directory creates a separate playlist, with a name based on the filename of the file that created it. <br/>The GUID of each playlist is based on the filename. <br/>If the `path` argument is a file, that file will be used to create a new playlist, with the name based on the filename of the file that created it. <br/>The GUID of each playlist is based on the filename.<br/> | /home/barkley/playlist.m3u |
|
||||
| `force` | [operations.Force](../../models/operations/force.md) | :heavy_check_mark: | force overwriting of duplicate playlists. By default, a playlist file uploaded with the same path will overwrite the existing playlist. <br/>The `force` argument is used to disable overwriting. If the `force` argument is set to 0, a new playlist will be created suffixed with the date and time that the duplicate was uploaded.<br/> | |
|
||||
| `force` | [operations.Force](../../models/operations/force.md) | :heavy_check_mark: | Force overwriting of duplicate playlists. <br/>By default, a playlist file uploaded with the same path will overwrite the existing playlist. <br/>The `force` argument is used to disable overwriting. <br/>If the `force` argument is set to 0, a new playlist will be created suffixed with the date and time that the duplicate was uploaded.<br/> | |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
@@ -140,7 +140,7 @@ func main() {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if res.ResponseBodies != nil {
|
||||
if res.Object != nil {
|
||||
// handle response
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,6 @@ import(
|
||||
"github.com/LukeHagar/plexgo"
|
||||
"context"
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -41,7 +40,7 @@ func main() {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if res.StatusCode == http.StatusOK {
|
||||
if res.Object != nil {
|
||||
// handle response
|
||||
}
|
||||
}
|
||||
@@ -76,7 +75,6 @@ import(
|
||||
"github.com/LukeHagar/plexgo"
|
||||
"context"
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -90,7 +88,7 @@ func main() {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if res.StatusCode == http.StatusOK {
|
||||
if res.Object != nil {
|
||||
// handle response
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,6 @@ import(
|
||||
"github.com/LukeHagar/plexgo"
|
||||
"context"
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -41,7 +40,7 @@ func main() {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if res.StatusCode == http.StatusOK {
|
||||
if res.Object != nil {
|
||||
// handle response
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user