Jump to content

Search the Community

Showing results for tags 'powershell'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • General
    • Announcements
    • Emby Premiere Purchase/Subscription Support
    • Feature Requests
    • Tutorials and Guides
  • Emby Server
    • General/Windows
    • Android Server
    • Asustor
    • FreeBSD
    • Linux
    • NetGear ReadyNAS
    • MacOS
    • QNAP
    • Synology
    • TerraMaster NAS
    • Thecus
    • Western Digital
    • DLNA
    • Live TV
  • Emby Apps
    • Amazon Alexa
    • Android Mobile
    • Android TV / Fire TV
    • Emby Theater
    • iOS
    • Apple TV
    • Kodi
    • Raspberry Pi
    • Roku
    • Samsung Smart TV
    • Sony PlayStation
    • LG Smart TV
    • Web App
    • Windows Media Center
    • Plugins
  • Language-specific support
    • Arabic
    • Dutch
    • French
    • German
    • Italian
    • Portuguese
    • Russian
    • Spanish
    • Swedish
  • Community Contributions
    • Ember for Emby
    • Fan Art & Videos
    • Tools and Utilities
    • Web App CSS
  • Other
    • Non-Emby General Discussion
    • Developer API
    • Hardware
    • Media Clubs
    • Legacy Support


  • Emby Blog

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...

Found 4 results

  1. Hello all I would like to get the information about exactly one movie using the API /Users/{UserId}/Items, using Powershell 5.1 on Windows 10. Authentication as a user works fine. Searching directly for the title works fine and returns two items. # Code: $mu = 'http://myembyserver:8096/users/' + $uid + '/items?SearchTerm="Southpaw"&Recursive=true&api_key=' + $apikey Invoke-WebRequest -Uri $mu -Method Get -ContentType "application/json" # Result: StatusCode : 200 StatusDescription : OK Content : {"Items":[{"Name":"Southpaw","ServerId":"721f2a80d300464984d9a0e141800e84","Id":"30969","RunTimeTic ks":74554990000,"IsFolder":false,"Type":"Movie","UserData":{"PlaybackPositionTicks":0,"PlayCount":0 ,"... However, when I use the parameter AnyProviderIdEquals 0 items are returned. # Code: $mu = 'http://myembyserver:8096/users/' + $uid + '/items?AnyProviderIdEquals="imdbid.tt1798684"&Recursive=true&api_key=' + $apikey Invoke-WebRequest -Uri $mu -Method Get -ContentType "application/json" # Result: StatusCode : 200 StatusDescription : OK Content : {"Items":[],"TotalRecordCount":0} RawContent : HTTP/1.1 200 OK Access-Control-Allow-Headers: Accept, Accept-Language, Authorization, Cache-Control, Content-Disposition, Content-Encoding, Content-Language, Content-Length, Content-MD5, Content-Rang... Also with the tmdbid (tmdbid.307081) the result looks the same. Even if I try to use this parameter in the Swagger UI, I get no result. What am I doing wrong? Many thanks in advance for your advice. Many greetings, Dani
  2. Hello all I'd like to update an item (a movie) using the code pattern from PenkethBoy ( Setting Folder Sort Sequence via API - Developer API - Emby Community ) The information is fetched using GET /emby/{UserId}/items/{ItemId}. Then exactly two pieces of information are changed: UserData.PlayCount and UserData.Played. Then the information should be updated using POST /emby/items/{ItemId}. # edit item $item.UserData.Played = $true $item.UserData.PlayCount = 1 # update item $url = $es + "/Items/73667?api_key=" + $ac $result = Invoke-Webrequest -uri $url -Method POST -Body ( $item | ConvertTo-Json ) -ContentType "application/json; charset=utf-8" # returns StatusCode : 204 StatusDescription : No Content Content : {} ... Unfortunately this POST does not work as hoped. It returns 204 with no content and the item is not updated. In the Swagger UI the code 204 is not explained. In this forum I didn't find anything about it. Also in the wiki I found no hints regarding updating of items. What am I missing? (The user has the right to manage the emby server). Is there any further documentation? Many thanks in advance for any hint. Dani (Environment: Emby, Powershell-Script on Windows 10)
  3. For anyone like me who started off creating their library of media and and deciding at a later date that maybe they want to move the those movies into their own folders, but don't want to manually create thousands of folders, and then manually move the files, you can automate that process with PowerShell (on WIndows). Open up a PowerShell prompt and navigate to the directory with your movies being stored, in my case on a network share. cd \\unraid\media\movies Make sure this command will create a folder for every file in the directory you just navigated to. WARNING, I was lazy when I made this. This will technically create a folder for any object in the folder that has a period in the name. So, if for whatever reason, you already have folders with a period in the name, it will try to create a folder for it as well. If you already have a folder structure with periods, either don't use this or revise the command. Get-ChildItem | Where-Object {$_.Name -Like "*.*"} | Select BaseName | ForEach-Object {New-Item -Name $_.BaseName -ItemType "Directory"} This next command will actually move every item with a period in the name, into a folder of the same name, minus the file extension. So, if you have multiple copies of a movie, with multiple resolutions, or if you keep your metadata in NFO files, ALL of those files will be moved into the same folder. Get-ChildItem | Where-Object {$_.Name -Like "*.*"} | ForEach-Object {Move-Item $_.Name $_.BaseName}
  4. Hi all, I've been using emby as a service for while now, and having gone through quite a few updates of the server, have always found it a bit long-winded to complete the update steps, thanks to the emby installer automatically starting the desktop app version of the server rather than the service. I've finally got round to writing a quick PowerShell script that automates it a bit more: stop the current service, download the server installer, run the installer, kill the emby app and finally start the service again. I've posted it here in case anyone's got a similar workflow to me for updating emby, and is only marginally lazier than I am: # Installer download path $downloadPath = "$env:USERPROFILE\Downloads" # Stop the emby service $service = 'Media Browser' if ((get-service -DisplayName $service).Status -eq "started") { Stop-Service -DisplayName $service } # Download installer $filename = 'setup.exe' $source = "http://mb3admin.com/downloads/release/server/$filename" $destination = $downloadPath + $fileName Invoke-WebRequest $source -OutFile $destination # Run installer & $destination | Out-Null # Kill the emby app that gets started. $emby = Get-Process -Name MediaBrowser.ServerApplication -ErrorAction SilentlyContinue while (!$emby) { # Check the app is running. Wait until it starts Sleep 5 $emby = Get-Process -Name MediaBrowser.ServerApplication -ErrorAction SilentlyContinue } Stop-Process $emby -Force Sleep 5 # Delete downloaded installer Remove-Item $destination #Restart the emby service Start-Service -DisplayName $service
  • Create New...