Jump to content

Using the /Collections API to create a new collection


HawkXP71

Recommended Posts

HawkXP71

Im running into a problem with the /Collections api

the URL I am sending is the following

http://mediabox:8096/Collections?api_key=XXXXXXXXXXX&IsLocked=false&Name=AFI%20top%2010%20Animation&Ids=265539,265222,265112,232588,265111,265495,230435,209878,265114,265510

Which should create a new Collection name "AFI top 10 Animation" with 10 movies in the collection.

However, I am getting "Unable to find the specified file." for the response.

Any help would be appreciated

Link to comment
Share on other sites

  • 1 month later...
akacharos

I figured it out.  I guess my problem was with the parsing of id's. 

If it helps anyone for future reference, here's my python snippet. 

movie_ids = ",".join(str(movie) for movie in movies)
response = requests.post(f'https://yourservername.home/Collections?api_key={api_key}&IsLocked=false&Name={collection_name}&Movies&Ids={movie_ids}')

 

  • Thanks 1
Link to comment
Share on other sites

HawkXP71
19 hours ago, akacharos said:

I figured it out.  I guess my problem was with the parsing of id's. 

If it helps anyone for future reference, here's my python snippet. 

movie_ids = ",".join(str(movie) for movie in movies)
response = requests.post(f'https://yourservername.home/Collections?api_key={api_key}&IsLocked=false&Name={collection_name}&Movies&Ids={movie_ids}')

 

Sorry, been dealing with a ton of server (non-emby) issues over the last 2 days.  Glad you got it working

  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...