Search the Community
Showing results for tags 'Server'.
-
I have a lot of people using my emby (10 on average). When I do maintenance on it, it's no longer active. I'd like to add a button on the login page so that people who use my Emby know why it's not working. Is this possible? On the application?
-
HOW TO - Watch Youtube Live/Twitch streams on Emby with TVHeadend
Facy5 posted a topic in Tools and Utilities
Hello everyone ! Seeing a lot of people want to add Youtube Live channels in their IPTV section, and knowing you can't simply add a Youtube Live stream link in your .m3u because YTLive links change every 3 to 6h (unless you want to edit your playlist and refresh Emby everytime, which would be a nightmare), this is a (quiet long) tutorial to show you how to make Youtube Live (but also Twitch or Dailymotion) streams work like a real TV channel in Emby. I based this how to on my own knwoledge (basically none in Linux, a lot of trial and error), and the tutorial by Carlos Gomes, available here : https://cgomesu.com/blog/Tvhlink/ All the tutorial is setup on a Windows 10 machine. You will need : - a Windows 10 (build 19041 and higher) or Windows 11 machine - Windows subsystem for Linux (can be version 1) - WSL to make short - a Linux distribution of your choice (preferably Debian or Ubuntu) - TVHeadend - Streamink - the TVHeadend plugin from the Emby plugin store 1) Install Windows subsystem for Linux. For Windows 10 below build 19041 : Open Powershell in admin mode, copy/past these commands : dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart The Linux distributions available are : Ubuntu, Debian, kali-linux, Ubuntu-18.04, Ubuntu-20.04, Ubuntu-22.04, OracleLinux_8_5, OracleLinux_7_9, SUSE-Linux-Enterprise-Server-15-SP4, openSUSE-Leap-15.4 , or openSUSE-Tumbleweed. Then, still in the Powershell, download your distribution of your choice : To install Ubuntu 22.04 : curl.exe -L -o ubuntu.appx https://aka.ms/wslubuntu2204 For Debian : curl.exe -L -o debian.appx https://aka.ms/wsl-debian-gnulinux Then restart the computer. Optional : If you want to install WSL 2, check this link by Microsoft : https://learn.microsoft.com/en-us/windows/wsl/install-manual#step-4---download-the-linux-kernel-update-package For Windows 10 build 19041 and higher : In the Command Prompt (or in Windows Terminal, available in the Windows Store) in admin mode, with WSL 2 already installed : (without the < > ) wsl --install -d <Distribution Name> For Ubuntu 22.04 : wsl --install -d Ubuntu-22.04 or, for Debian : wsl --install -d Debian Then restart the computer. 2) Install TVHeadend Go to the download page : https://tvheadend.org/projects/tvheadend/wiki/AptRepositories For Ubuntu, the easy way is to install via PPA : sudo apt-add-repository ppa:mamarley/tvheadend-git sudo apt update sudo apt install tvheadend For Debian, because the distribution can't handle PPA, to have to do this : curl -1sLf \ 'https://dl.cloudsmith.io/public/tvheadend/tvheadend/setup.deb.sh' \ | sudo -E bash Then after, the usual : sudo apt update sudo apt install tvheadend Once TVHeadend, and all its dependancies, donwloaded and installed, the install wizard will automatically be launched. You just have to create an admin ID and a password, leave the rest by default. 3) Install Streamlink ! For Debian, make sure you have backports repositories installed, otherwise you will get an older version of Streamlink and cause Python errors in TVHeadend ! echo "deb http://deb.debian.org/debian bullseye-backports main" | sudo tee "/etc/apt/sources.list.d/streamlink.list" sudo apt update sudo apt -t bullseye-backports install streamlink 4) Start the TVHeadend server : sudo tvheadend Wait a little, untill you see this line in blue (of course, the number version could vary with future update) : [ NOTICE] START: HTS Tvheadend version 4.3-2106~g9e1eb89be started Go to the webserver page of TVHeadend : http://localhost:9981/ Warning ! If after entered your admin ID, the page show you a 403 Forbidden error, type : sudo tvheadend -C It will show you the post install wizard to configure admin ID's (keep the same as the install) and a client ID (you can just keep the same ID as the admin account). Now : a) set up TVHeadend -> https://cgomesu.com/blog/Tvhlink/#basic-configuration b) create an automatically updated .m3u with Youtube Live/Twitch ... -> https://cgomesu.com/blog/Tvhlink/#automatic-network-of-livestream-channels If you create your .m3u from Windows (with Notepad ++ for exemple), I strongly suggest you to save it in your Linux home folder. Once done, you need to modify the permission of your .m3u, otherwise TVHeadend won't have the permission to handle it. To do so : cd path/of/your/playlist/ chmod +rwx yourplaylist.m3u Basically, your .m3u shoud look like this : #EXTM3U #EXTINF:-1 tvg-id="ChannelID.ShortCountryCode" tvg-country="ShortCountryCode",Name of the channel pipe:///usr/bin/env streamlink --stdout --default-stream best --url https://www.youtube.com/user/ChannelName/live 5) Install the TVHeadend plugin You can find it in the Emby plugin store, in the Live TV category. Once installed, restart your Emby server. Then, in the admin pannel, in the Live TV section : Add a new TV source -> select TVHeadend If you installed the TVHeadend server on the same computer of the Emby server, change the Tvheadend Server Web Interface URL with : http://127.0.0.1:9981 instead of http://localhost:9981 If you installed on another computer of your network, enter its local IP adress, and the port number : 9981 Enter admin ID and password -> Save Refresh data guide. Now Emby can play Youtube Live/Twitch/Dailymotion (and many others) livestreams ! (If I have some time, I could edit this post with pictures. if I misspelled or misspoke something, please forgive me, English isn't my mother tongue.)- 1 reply
-
- 2
-
-
- youtube live
- twitch
-
(and 8 more)
Tagged with:
-
Hi, I've been using Emby for at least month on a temporary server and now consider buying premiere sub, there are some movie collections though that I configured myself, creating custom images, thumbs, description, etc. Will those images and descriptions carry over (if I have premiere sub) when I install Emby server on a dedicated linux server (using the same hdd, but obviously different os) and do backup and restore? OCD kinda kicks in and I really like how I organize my files. Thank you.
-
Quick question! Is it possible to run an Emby Server on a Chromebook? I wasn't sure if it would be the same as installing it on an Android platform like the Nvidia Shield. Recently found a deal on one and considering buying it.
-
Server - Kill current transcode/streaming sessions from the server
Florux posted a topic in Feature Requests
Hi, On the Server you can currently see active devices on the dashboard, and consequently which users are watching what on what media. However, there's no way to abort these active devices to either conserve bandwidth, conserve server CPU, or simply to stop a renegade process. One use case that would be particularly helpful is when you're casting from the phone app to ChromeCast. If the phone gets interrupted, you lose control over the stream so that the TV stops showing whatever you were watching, and there's no way to stop it or regain control over it. Instead of having to stop and start the entire server, it would be nice to just click on that particular activity on the dashboard and press KILL (or perhaps a less dramatic word - cancel?) Food for thought? -Florux- 28 replies
-
- 16
-
-
Hello, I want to notify you that for the moment my Windows operating system server was not affected by the vulnerability, everything works normally. Since I became aware of the serious problem with the vulnerability, I have adopted some measures, first I eliminated all the users who had privileges to administer the server and I created new users to transmit local and remote streaming without a password but without no privilege to manage my server, at the same time I also created a new user with administrator privileges to exclusively manage the server but never use it to stream on the local network, nor remote streaming. Also, for the new exclusive user to administer the server, I configured the option to not allow remote connections to that user, so that user is only accessible from the computer where the server is installed. For all this that I am explaining to you, I ask you if it is safe for me to use all the users to do local and remote streaming without the privilege of managing my server, and that I have an exclusive user to manage the server with the remote connection disabled and also hidden from all local and remote clients, in this way the exclusive users for streaming can continue working without any password. Since it is very annoying to have to be typing passwords in the local network. Besides, I use the Beta version for windows with the current version 4.8.0.37 and I think that the vulnerability affected the stable version more. ¿Can I safely continue to use all users without exclusive passwords for streaming, but without any privileges to administer the server, and with another unique user exclusive to administer the server with the remote connection disabled, and hidden from all local clients and blunt?
-
Hi Guys. Right, I have been using a mini pc for Emby (originally Plex) and now finding that its not up to the job as much as i would have hoped. I was using an AMD based TriKey Mini PC. It has served me well for the most part. It did at least handle HW encoding. But.. I would like an Intel based setup now that supports the superior Quick Sync. So, criteria is really just a MINI pc that has storage space for 2 drives (NVMe/SSD) so I can have one for Emby, and the other for incremental backups, everything else is on a large nas. Suggestions all welcomed.
-
Hi, I have a problem whereby I had a fully working setup using Emby docker. The setup involves docker installed on Windows 11 (using docker-compose). I then have an old PC with Ubuntu installed to function as a NAS where all my media is stored. I recently moved for work and this meant that I required a slightly different LAN setup at home, as well as changing the name of the Ubuntu server. A couple of weeks ago, I realized that while I had added some media to my Ubuntu server (NAS), Emby had not updated this (only with the movies... TV Shows on the same server in the same storage folder were being discovered without any issues). As such, I thought I would reset everything, so I created a completely new docker container and used exactly the same NAS connection in 'docker compose' apart from changing the link to the Ubuntu server name from its IP address to its server name. However, that has not resolved the problem, now I have all my media apart from movies. The odd thing is when I am setting up my library, Emby can find the movie folder and shows me when I have selected the movie folder all the subfolders with the movies. So the connection with the server is not blocked... it is simply that it can't seem to identify all the movies in these subfolders? Any thoughts would be welcome... I attach logs... Thanks embyserver.txt
-
Is there a way for the 4k and standard def versions to default combine instead of defaulting to split? They are two folders but in the same library and by default they are creating as split items instead of a grouped version. On this same topic if there is a grouped version of the movies can you still have coverart tag it with 4k if there is a 4k movie in there?
-
I request a zip for portable installation of the Beta versions
Fabian2101 posted a topic in General/Windows
Hi, I want to ask you if you can provide me with a link so that I can download the Beta version 4.8.0.21 of the server for windows, but with a zip file and a portable installation. I always prefer to use the completely portable installation, so I have the servers in my portable programs folder, and this is much easier for me when I have to format and delete all the data on my hard drives, since I always before format and delete my internal hard drives I copy the portable programs folder on the external USB hard drive or flash drive. So I don't have to spend time reinstalling all the programs from scratch when I format my internal hard drives. And I also don't waste time reconfiguring all the server configuration options from scratch. But the problem is that the download section of the server for windows, there is no portable download of the Beta version, and besides the installation file of the Beta version does not even allow to choose the location path for the installation. https://emby.media/windows-server.html For this reason I ask you for a link so that I can download the Beta version 4.8.0.21 with completely portable installation, identical to the portable one of the stable version of the server. Thanks -
Background Plugins, extensions and integrations make an important part of the Emby ecosystem. Plugin development is open to everybody and many great plugins have been created by Emby community members. To show our appreciation for the great work and achievements of community developers, we took steps in order to improve in an area where we haven't done that well in the recent past: Developer Support. When talking about support, there are several different facets to evaluate and consider. We probably did fairly well when it was about responding to user questions - but not that much when it came to providing accurate and up-to-date information, documentation and code examples. Emby SDK It has been just about time to make a change to that and over the past months we have intensively worked on improving that situation. Eventually, we have ended up with a fully loaded package of information, resources, tools and sample code - exclusively for all of you developers, so today we're proud to present: The EMBY SDK https://github.com/MediaBrowser/Emby.SDK Website - emby dev In parallel to the SDK, we are launching: the new emby developer site https://dev.emby.media Introduction Video For a comprehensive introduction to the Emby SDK, watch the video, either by installing the Plugin for The Emby Show Or watch it on YouTube: The Emby Show Episode 3 - Emby SDK - or below Questions? Please ask questions in the developer forum: https://emby.media/community/index.php?/forum/47-developer-api/ Watch
-
repeat diskAccess @Emby:Sessions/Playing/Progress even when 'paused'?
pgemby posted a topic in Synology
I run Emby Server 4.7.8.0-704070800 on a 4-disk/RAID-10 Synology NAS DS918+ (DSM 7.1.1-42962 Update 1) It serves as backend to LAN clients running Kodi 19.4/Linux with Emby for Kodi Next Gen v7.9.4 plugin. Everything works as expected; zero problems serving up videos. One minor issue that I've been trying to 'solve'. If I launch a vid (either in client Kodi player, or in client browser to Emby webUI) and hit 'pause' -- so the movie's queued up to play, but not streaming -- I notice regularly repeating 4-disk access. Every few seconds, all 4 of the NAS's disk-LED's blink and I hear disk access. This will simply repeat forever, until I 'stop' the movie, rather than just 'pause' it. I turned on debug logs to take a look, and see: with access from Kodi client, ``` ... 2022-10-30 19:33:17.791 Info Server: http/1.1 POST http://10.0.9.18:8096/emby/Sessions/Playing/Progress?CanSeek=True&QueueableMediaTypes=Video%2CAudio&IsPaused=True&ItemId=47937&MediaSourceId=7a...d6&PositionTicks=100000000&RunTimeTicks=63149443359&VolumeLevel=100&IsMuted=False. UserAgent: Emby for Kodi Next Gen/7.9.4 2022-10-30 19:33:17.792 Debug SessionManager: OnPlaybackProgress StateChange 8756d1f9a0b84bd6ae7ae63a7be446d6 2022-10-30 19:33:17.793 Info Server: http/1.1 Response 204 to 10.1.1.7. Time: 2ms. http://10.0.9.18:8096/emby/Sessions/Playing/Progress?CanSeek=True&QueueableMediaTypes=Video%2CAudio&IsPaused=True&ItemId=47937&MediaSourceId=7a...d6&PositionTicks=100000000&RunTimeTicks=63149443359&VolumeLevel=100&IsMuted=False 2022-10-30 19:33:21.799 Info Server: http/1.1 POST http://10.0.9.18:8096/emby/Sessions/Playing/Progress?CanSeek=True&QueueableMediaTypes=Video%2CAudio&IsPaused=True&ItemId=47937&MediaSourceId=7a...d6&PositionTicks=100000000&RunTimeTicks=63149443359&VolumeLevel=100&IsMuted=False. UserAgent: Emby for Kodi Next Gen/7.9.4 2022-10-30 19:33:21.800 Debug SessionManager: OnPlaybackProgress StateChange 8756d1f9a0b84bd6ae7ae63a7be446d6 2022-10-30 19:33:21.801 Info Server: http/1.1 Response 204 to 10.1.1.7. Time: 2ms. http://10.0.9.18:8096/emby/Sessions/Playing/Progress?CanSeek=True&QueueableMediaTypes=Video%2CAudio&IsPaused=True&ItemId=47937&MediaSourceId=7a...d6&PositionTicks=100000000&RunTimeTicks=63149443359&VolumeLevel=100&IsMuted=False 2022-10-30 19:33:25.807 Info Server: http/1.1 POST http://10.0.9.18:8096/emby/Sessions/Playing/Progress?CanSeek=True&QueueableMediaTypes=Video%2CAudio&IsPaused=True&ItemId=47937&MediaSourceId=7a...d6&PositionTicks=100000000&RunTimeTicks=63149443359&VolumeLevel=100&IsMuted=False. UserAgent: Emby for Kodi Next Gen/7.9.4 2022-10-30 19:33:25.808 Debug SessionManager: OnPlaybackProgress StateChange 8756d1f9a0b84bd6ae7ae63a7be446d6 2022-10-30 19:33:25.808 Info Server: http/1.1 Response 204 to 10.1.1.7. Time: 2ms. http://10.0.9.18:8096/emby/Sessions/Playing/Progress?CanSeek=True&QueueableMediaTypes=Video%2CAudio&IsPaused=True&ItemId=47937&MediaSourceId=7a...d6&PositionTicks=100000000&RunTimeTicks=63149443359&VolumeLevel=100&IsMuted=False ... ``` and similarly with Emby WebUI access, from Firefox ``` ... 2022-10-30 19:51:03.215 Info Server: http/1.1 POST http://syno.lan:8096/emby/Sessions/Playing/Progress?X-Emby-Client=Emby Web&X-Emby-Device-Name=Firefox&X-Emby-Device-Id=89...df&X-Emby-Client-Version=4.7.8.0&reqformat=json. UserAgent: Mozilla/5.0 (Windows NT 10.0; rv:106.0) Gecko/20100101 Firefox/106.0 2022-10-30 19:51:03.216 Debug SessionManager: OnPlaybackProgress TimeUpdate aa648724be6241d2a6b5949b32cb818a 2022-10-30 19:51:03.217 Info Server: http/1.1 Response 204 to fd70:28:9:18:6d9:f5ff:fe7c:1c62. Time: 2ms. http://syno.lan:8096/emby/Sessions/Playing/Progress?X-Emby-Client=Emby Web&X-Emby-Device-Name=Firefox&X-Emby-Device-Id=89...df&X-Emby-Client-Version=4.7.8.0&reqformat=json 2022-10-30 19:51:13.217 Info Server: http/1.1 POST http://syno.lan:8096/emby/Sessions/Playing/Progress?X-Emby-Client=Emby Web&X-Emby-Device-Name=Firefox&X-Emby-Device-Id=89...df&X-Emby-Client-Version=4.7.8.0&reqformat=json. UserAgent: Mozilla/5.0 (Windows NT 10.0; rv:106.0) Gecko/20100101 Firefox/106.0 2022-10-30 19:51:13.218 Debug SessionManager: OnPlaybackProgress TimeUpdate aa648724be6241d2a6b5949b32cb818a 2022-10-30 19:51:13.219 Info Server: http/1.1 Response 204 to fd70:28:9:18:6d9:f5ff:fe7c:1c62. Time: 4ms. http://syno.lan:8096/emby/Sessions/Playing/Progress?X-Emby-Client=Emby Web&X-Emby-Device-Name=Firefox&X-Emby-Device-Id=89...df&X-Emby-Client-Version=4.7.8.0&reqformat=json 2022-10-30 19:51:23.218 Info Server: http/1.1 POST http://syno.lan:8096/emby/Sessions/Playing/Progress?X-Emby-Client=Emby Web&X-Emby-Device-Name=Firefox&X-Emby-Device-Id=89...df&X-Emby-Client-Version=4.7.8.0&reqformat=json. UserAgent: Mozilla/5.0 (Windows NT 10.0; rv:106.0) Gecko/20100101 Firefox/106.0 2022-10-30 19:51:23.219 Debug SessionManager: OnPlaybackProgress TimeUpdate aa648724be6241d2a6b5949b32cb818a 2022-10-30 19:51:23.220 Info Server: http/1.1 Response 204 to fd70:28:9:18:6d9:f5ff:fe7c:1c62. Time: 2ms. http://syno.lan:8096/emby/Sessions/Playing/Progress?X-Emby-Client=Emby Web&X-Emby-Device-Name=Firefox&X-Emby-Device-Id=89...df&X-Emby-Client-Version=4.7.8.0&reqformat=json ... ``` "Sessions/Playing/Progress" seems the common element. Something constantly polling for progress? Is this expected/normal behavior for Emby? (How) can this be disabled, or tamed? -
Error: This server needs to be updated when connecting via apps
heypaleblue posted a topic in General/Windows
I have my emby server on a LAN network in my home (192.168.1.1 lets call it) , I have a VPN Server running on another network in my home to make the media server available for remote users (192.168.2.1 lets call it). I can see my VPN Clients connecting to the server from the embyserver.txt log, but clients are getting the error that the server needs to be updated leaving me unable to use the server. The server works just fine on the same devices connected to the LAN via wifi. I'm running Version 4.7.10.0 emby lifetime on a fully patched windows 10 box. -
-
Hello. I have been using Emby as a Premiere user for some time now with the server installed on a Windows 10 PC as my previous Synology NAS did not support the Emby Server Package. I now have a shiny new DS1821+ and would like to move my Emby server over to that. Is there any way to migrate the database over? I have used all UNC paths in the existing server so the paths should be the same. I also have another issue though which I might need to resolve first? For some reason I can access the new Emby Server on the DS1821+ using https://IP address:8096 but I have a proper domain configured and have redirected the port 8096 in my router to point to the new IP address of the NAS. But for some reason I cannot connect using the actual https://Domain.ca:8096. The page just times out eventually saying it cannot be found? It does seem to take quite some time before it times out though. Prior to setting up the new DS1821+ I was able to connect to my PC Emby server with my domain.ca:8096 but I had the 8096 port forwarded to my PC instead of the NAS. Any help on either of these 2 issues much appreciated. Edit: I just tried to connect using "https://my external IP address:8096". It would not work if I preceded it with "https" but seems to work fine once I removed the "https". Though it comes up as "Not Secure". I am sure this is related to why I cannot connect using my "domain.ca:8096" Thanks. Carl
-
One of the supported TV file naming conventions is: 02 Episode Name.extFor a show that airs every weekday, the episode number often grows to three digits. For example: /Some Show/Season 2/123 Some Title.m4v Emby mis-identifies the file above as Some Show, Season 1 (even though it is in the Season 2 folder), Episode 23 (even though the filename has the number 123 in it). Is it really not possible to support this format for three digit episode numbers?
-
When I click 'Save' Button, the problem will occur.(Picture 1) But When I return to the user page, it seems that it has been created successfully. Also, I can log in with this 'Ghost User'. However I cant edit any settings of this user, there is no any new user in /config/user, user.db in /data wasnt updated. Restarting emby and vps has been tried but doesnt work. Anyone know how to deal with it plz?
-
I am also having this exact issue and this is extremely frustrating. The stream will hang randomly (it could be 5, 15 or 30 mins) but if it doesn't, it will ultimately crash at around 4 hours of continuous playing. The transcoding log gives zero information as it only hangs there until I quit the frozen stream and then it logs "user quit"... The emby server log has the errors as mentionned by the first posts in this thread. In exemple : 2022-07-31 09:47:41.193 Info HttpClient: Http response 404 from http://host6/x_path4_x/x_path21_x after 175ms. HeadersServer=nginx, Date=Sun, 31 Jul 2022 13:47:41 GMT, Connection=close, Access-Control-Allow-Origin=* The most frustrating part is if and when I use VLC to watch/decode the M3U link, the stream works flawlessly and will keep going for days. There must be something you guys can do about it..?
-
Hi @Luke I am running emby server 4.7.5.0 on Ubuntu 20.04.4 LTS. Not sure when this stopped working as I mainly access my server locally via http but setup HTTPS on port 8920 behind HAProxy and was working fine. I saw an error no backend to emby in HAProxy so investigated and indeed I cannot access the server at all on https. If I curl from the emby server I get this error curl: (7) Failed to connect to localhost port 8920: Connection refused
-
Hi, When I watch something on my LG TV, it sometimes pauses the show then a couple of seconds later it continues. Other times it just totally goes to a black screen with the circle in the middle going around and around. The only way to fix it is go into Task manager and close the embyserver process and then re-open the emby server. I have included my log file hoping someone might have a clue or an idea why it keeps doing this. embyserver.txt
-
I just recently set up a file server running Open Media Vault and I saw that you can run your Emby Server on that. But I am confused at how to install it because it has no graphic interface and I manage it remotely with the Web UI that is provided with it. I would like to install it on there and then move all of my movies to it so that it is no longer reliant on my desktop computer. If someone could please provide me with the details on how to install it, I would greatly appreciate it.
-
Server 4.7.4.0 on Ubuntu 20.04 - display bug in Network information
rotational467 posted a topic in Linux
Hi there! I noticed after installing 4.7.4.0 that there is a bug in the Dashboard for the server's network address. I'm not sure if this existed prior to 4.7.4.0 because I just recently changed the default HTTPS port. Anyway as per the screenshot, the listed WAN address shows the default 8920 port and not the custom port. I can confirm that Emby really is listening on the custom port and not 8920, so this seems to simply be a display artifact. -
Emby Server Update "Please restart the server..." no update happens
phlox posted a topic in General/Windows
I did a quick search and didn't see this anywhere so apologies if this is a duplicate issue. I have updates turned on and the server should reboot itself, however, whenever it "updates" it reboots and loads to the previous version (currently 4.7.1.0 trying to update to 4.7.2.0) and then continues to give a "Please restart the server to finish applying updates." It did this when updating to 4.7.1.0 from the version before that as well and i manually downloaded and installed the version. But i don't want to have to keep doing that. How can I get the server to actually complete the installs to the new versions? Operating in Windows 10 (Pro) -
Hi, I'm new here. I added several movies to my library, but the names weren't 100% accurate, for example: "expendables.mkv", which was recognized as "expendables 4" I don't know if Emby would need the information there like "expendables 1.mkv", but there are several of these movies that were added that ended up like this, having only the name of the movie, without informing the "order" (like the movie "Scream .mkv" which emby recognized as "Scream 5"). In a "Manga" reader that i did, i make this code to "find" the most probably correct match. I'm not a developer, i just tryed make the code until it give-me a good result. Code running with 2473 movies in db, and it find the match easily (I used it a lot with all 1.378 manga that i have, and it update each correctly, without a problem), so... Is there a way to implement something like this on emby? I know that the code is way to not optimized, but, for now is what i can do. Code: function GetAllMangaMatches(Lista, Nome){ let NovaLista = Clone(Lista); let Retorno = {Vazio: ''}; let Mangas = []; let Counter = 0; while (!Empty(Retorno)) { if(Counter > Lista.length) break; Retorno = FiltrarManga(NovaLista, Nome); if(!Empty(Retorno)) { Mangas.push(Retorno); delete(NovaLista[NovaLista.indexOf(Retorno)]); NovaLista = CleanArray(NovaLista); } Counter++; } return Mangas; } function Clone(Objeto) { let Copia = null; if(!Array.isArray(Objeto)) Copia = Object.assign({}, Objeto) else Copia = Object.keys(Objeto).map((key) => Objeto[key]); return Copia; } function Empty(Object) { return $.isEmptyObject(Object); } function FiltrarManga(Lista, Nome){ if (Lista.length == 0) return ''; let Manga = []; let CountMax = 0; let Count = 0; let ListaNomes = arrayColumn(Lista, "Name"); ListaNomes = ChangeCase(ListaNomes, toLowerCase); Nome = RemoverCaracteresEspeciais(Nome.toLowerCase()); let NomeArray = Nome.split(' '); NomeArray = CleanArray(NomeArray); let isOrigemDoujinshi = NomeArray.includes('doujinshi'); let SelectedValue = []; let isMatchDoujinshi = false; x = 0; let foundExact = false; ListaNomes.map(function(value){ if(foundExact) return; value = RemoverCaracteresEspeciais(value); if (value == Nome) { Manga = Lista[x]; foundExact = true; return Manga; } Count = GetOcorrencias(value, Nome); if (Count > CountMax) { CountMax = Count; Manga = Lista[x]; SelectedValue = value.split(' '); SelectedValue = CleanArray(SelectedValue); isMatchDoujinshi = SelectedValue.includes('doujinshi'); } x++; }) let NomeArraySize = NomeArray.length; if (((CountMax > NomeArraySize*0.9) && (NomeArraySize + 3 > SelectedValue.length) || (foundExact)) && (isMatchDoujinshi == isOrigemDoujinshi)) { if(Manga != undefined) { if(Manga.length == 0) { Manga = Lista[0]; } } else { Manga = Lista[0]; } } else { return []; } return Manga; } function arrayColumn(array, columnName) { return array.map(value => value[columnName]) } function ChangeCase(Elemento, CaseFunction, Parameters) { switch (typeof(Elemento)) { case 'string': return CaseFunction(Elemento, Parameters); break; case 'object': if(Array.isArray(Elemento)) { return Elemento.map(x => ChangeCase(x, CaseFunction, Parameters)); } else { if(Elemento != null) { let ElementTemp = {}; Object.keys(Elemento).map(function(key){ ElementTemp[key] = ChangeCase(Elemento[key], CaseFunction, Parameters); }) return ElementTemp; } else return null; } break; default: return Elemento; break; } } function RemoverCaracteresEspeciais(texto, subst = ' ') { let pattern = /[^a-z1-9]/gi; return texto.replaceAll(pattern, subst); } function CleanArray(Array) { return Array.filter(x => !$.isEmptyObject(x)); } function GetOcorrencias(Fonte, Busca) { let ArBusca = RemoverCaracteresEspeciais(Busca).toLowerCase().split(' '); ArBusca = CleanArray(ArBusca); Fonte = RemoverCaracteresEspeciais(Fonte).toLowerCase(); let Contagem = 0; ArBusca.map(function(value){ if(Fonte.indexOf(value) != -1) Contagem += 1; }) return Contagem; } function GetAllMangaMatches(Lista, Nome){ let NovaLista = Clone(Lista); let Retorno = {Vazio: ''}; let Mangas = []; let Counter = 0; while (!Empty(Retorno)) { if(Counter > Lista.length) break; Retorno = FiltrarManga(NovaLista, Nome); if(!Empty(Retorno)) { Mangas.push(Retorno); delete(NovaLista[NovaLista.indexOf(Retorno)]); NovaLista = CleanArray(NovaLista); } Counter++; } return Mangas; } function toLowerCase(Texto) { return Texto.toLowerCase(); } function AddScriptByJavascript(src){ script = document.createElement('script'); script.src = src; document.body.appendChild(script); } AddScriptByJavascript("https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"); Ps: I Also add there a code "Importer" to add jquery, because the function from jquery "$.isEmptyObject(Object)" is needed. If wanna me to translate the function/parameters to english, i can do too.
- 12 replies