Req Hide unavailable library items
#1
Hi,

I have several video sources: my NAS, local files, and some FTP sources that my friends have set up at their homes.

The problem is that they don't always have their servers up, which means that a lot of the movies in the library sometimes can't be played. Since there is no way of knowing the source of the movie in the library, I don't know which ones are playable and which ones aren't. The same problem occurs if you have a removable drive, add that as a library source, and then only have it plugged in occasionally.

The feature I'm suggesting is that there is a checkbox available for each source that says something like "remote source", or "removable". If that is checked, the availability of the source should be checked (by trying to access the source) every time you open the library. If the source is unavailable, hide those items from the library that time. To be clear: don't remove the source, just hide it that time. The next time you enter the library, check the availability and if it's there, show it.

I'm willing to put some time into implementing this, but I don't know where to start. I have the environment set up but don't know if this should be written as a plugin, script, skin feature, addon, or in Kodi itself.

I've looked at threads discussing something similar (e.g. http://forum.kodi.tv/showthread.php?tid=135501), but no solution.
Reply
#2
+1, this makes a lot of sense to me. The only thing I would add is that hiding the items from the library should be optional via a Library setting.
Reply
#3
(2015-08-07, 12:29)rysport Wrote: Hi,

I have several video sources: my NAS, local files, and some FTP sources that my friends have set up at their homes.

The problem is that they don't always have their servers up, which means that a lot of the movies in the library sometimes can't be played. Since there is no way of knowing the source of the movie in the library, I don't know which ones are playable and which ones aren't. The same problem occurs if you have a removable drive, add that as a library source, and then only have it plugged in occasionally.

The feature I'm suggesting is that there is a checkbox available for each source that says something like "remote source", or "removable". If that is checked, the availability of the source should be checked (by trying to access the source) every time you open the library. If the source is unavailable, hide those items from the library that time. To be clear: don't remove the source, just hide it that time. The next time you enter the library, check the availability and if it's there, show it.

I'm willing to put some time into implementing this, but I don't know where to start. I have the environment set up but don't know if this should be written as a plugin, script, skin feature, addon, or in Kodi itself.

I've looked at threads discussing something similar (e.g. http://forum.kodi.tv/showthread.php?tid=135501), but no solution.

It should probably be in the kodi core.

But I think hiding the items will be very confusing for some users, graying them out might be the better way? (do a test in core, put a bool somewhere and let the skinner decide how he wants to show it)
Reply
#4
I agree with Razze, don't hide but grey out or alike and let skin decide how this is indicated. We had this very same discussion in regards to the UPNP import feature, where AFAIK this is already handled that way (flag that item is offline and skins decide what to do).

I'm just not sure how to integrate this in current system, because the suggested "remote source" flag in source settings is not really helpful. We usually know from the protocoll used if it's a remote connection or not. Also a NAS could be considered remote. What IMO would make more sense would be a flag to enable/disable WOL for this source. If WOL is disabled and target doesn't respond the according item is considered "unavailable". If it does not respond, but WOL is enable for it, still mark it "available".
Reply
#5
Thanks for your input! I will start working on it but it's going to take a while as it will be my first Kodi contribution. I know nothing about writing code for WOL though, but I like the idea.
Reply
#6
(2015-08-07, 20:59)rysport Wrote: Thanks for your input! I will start working on it but it's going to take a while as it will be my first Kodi contribution. I know nothing about writing code for WOL though, but I like the idea.
Kodi does already support WOL and has everything in place. Also, the flagging of offline items could be taken from Montellese's UPNP media import branch on Github (read here for more details about this http://forum.kodi.tv/showthread.php?tid=224794 )
Reply
#7
WOL won't work with remote sources outside the LAN.
Reply
#8
(2015-08-08, 16:38)wsnipex Wrote: WOL won't work with remote sources outside the LAN.

Even if the port is forwarded? If so, I guess he could still do a VPN to that server. EDIT: doh, I guess he wouldn't be able to make a VPN connection to a sleeping sever.
Reply
#9
WOL is working on OSI layer 2(usually Ethernet), that is below IP and therefore is not routed.
Reply
#10
(2015-08-08, 23:08)wsnipex Wrote: WOL is working on OSI layer 2(usually Ethernet), that is below IP and therefore is not routed.

I do it all the time, though :)

The port is forwarded on the router and I need to know the MAC address of the computer I want to wake. I've done it with both Macs and PCs over the years. It's even an option to send the packet in a lot of remote app/VNC -type apps. Unless I've just been blessed by special hardware, I don't see why this wouldn't be possible for OP.
Reply
#11
well, thats not really ootb is it? Yes its possible to it with a gateway service. Over VPN the vpn gateway would send the magic packet.
Reply
#12
I don't have a "gateway service" or VPN. Just a plain router with port 9 being forwarded.
Reply
#13
please read the OP again. You cannot assume that everyone would have a way to WOL a remote server that can potentially anywhere and not in any way under the control of the user.
I for one, wouldn't let you WOL my servers, even if I gave you access to my library via ftp or whatever.
Reply
#14
I am not trying to argue. I am sincerely attempting to understand the situation. I don't know what "ootb" or a gateway service is, or even what "OSI layer 2" is. I looked it up and am trying to understand what I've read. Please don't hesitate to correct me if I am wrong about any of the conclusions I have drawn.

Quote:That's how WoL works on a LAN, but getting it to function via the Internet isn't nearly as straightforward. Delivering a magic packet to a router is simple enough, but the router must in turn be able to forward the incoming packet as a broadcast to the local network. Problem is, few if any consumer/small office routers allow this, as it's a big no-no for security reasons.

That seems to be what you were talking about, maybe?

Then it says this:

Quote:It is possible to get WoL to work across the Internet by giving a target PC a static or reserved DHCP IP address and configuring the router to forward the magic packet to that address. The problem is that this method won't work for long because once the PC is powered off its entry in the router's ARP cache (which maps IP addresses to MAC addresses) will expire (not immediately, but eventually) making the PC unreachable.

That seems to be what I am talking about, and the "problem" mentioned there seems to be easily solved by reserving an IP address based on the MAC address. In addition, another article I read says that some NICs can be configured to accept any packet on a specific port to wake up the computer.

Between those two situations, that seems to explain why I've been able to do this on several different computers, with several different consumer routers, hence my assumptions. If this is foolish or will cause my computer to explode, or a security risk then myself, please feel free to point that out. I've only seen a few comments to that effect, but most of them don't actually explain why this would be an issue, other than someone could possibly flood my network with some kind of DDoS, or just try to run my power bill higher by having my computers always run, but maybe there is more to it?


I hope I haven't offended you, and my posts here were just trying to understand the situation. I trust your judgement on these matters, and only wish to understand them better myself. Cheers.
Reply
#15
Montellese's contribution seems to include the exact thing I'm now working on. From his post:

Quote:When Kodi starts up it disables all library items that were imported from a provider because it doesn't know if the provider is available right now. Disabled is just a state of an item and could be used in skins to e.g. grey out these items in the list so that the user sees the item as part of the library but realizes that the source it came from is not available right now

So, should I continue working on this feature? Montellese seems to be very familiar with Kodi and will probably have a cleaner solution than me.

I've added a radiobutton in the GUIDialogContentSettings. That seems to work.
The thing is that the DB doesn't store the source, just path (the file path) and parentpath (which is just the folder that contains the file). Should I add a new table for sources with columns sourceId, path, hideFlag that updates whenever you change content on a source? Or is it better to add a column in the files table that has the hideFlag (which will cause redundancy I guess)? Another way would be to do a substring search between the source path and the path of each video file, but that seems clunky. Any suggestions?
Reply

Logout Mark Read Team Forum Stats Members Help
Hide unavailable library items0