Kodi Community Forum

Full Version: dynamic library based on source availability
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi
I'm looking for a solution for an dynamic library.
So at startup kodi should check which of the media sources is available and only show up items from available sources in the gui.

There are a few reasons for this:
Having kodi installed on a laptop it would allow you to add (network) sources from all your friends and wherever you go you can see what media is available. In the current setting you always see everything ever added and maybe most of it isnt usable because it from one of your friends.

Using removable storage. This feature gives the users the possibibility of using many removable storage and only showing items of the ones currently connected.

Cleaup library cannot accidentally delete parts of your lib just because a drive isnt connected or there is an network issue to your nas.
Quote:So at startup kodi should check which of the media sources is available
It does that already, but doesn't check the validity of sources.

An interesting view point, not quite what I see, but certain aspects brings some thoughts. I like the idea of my entire library available, even if the physical files are not online; great for checking meta-data and cast etc. details that would be hidden to searches, smart playlists, tags, sets if the library was truncated. I know what HD drives are online and what isn't when Kodi gives warning when I'm trying to play the item

Quote:Using removable storage
There are work-arounds for this. http://forum.kodi.tv/showthread.php?tid=96183 Some sort of source flag, colour coded or tag would allow some flexibility.

Quote:Cleaup library cannot accidentally delete parts of your lib just because a drive isn't connected or there is an network issue to your nas.
Clean-up now puts up a requester for the disposition of missing sources. (keep or Not).
I understand that having movie information is important for fans even if the movie is currently not able to Play.
maybe the request can be realized as an Options with 3 possibilities:

- Hide Items from library which are stored on offline sources
- Show Items, but greyed out (being able to watch informations about it, skip question if item should be deleted)
- Show Items normally
(2017-04-24, 18:31)Bitboy Wrote: [ -> ]I understand that having movie information is important for fans even if the movie is currently not able to Play.
maybe the request can be realized as an Options with 3 possibilities:

- Hide Items from library which are stored on offline sources
- Show Items, but greyed out (being able to watch informations about it, skip question if item should be deleted)
- Show Items normally
Yes the second suggestion would match up with both of our ideals, having all three options would be gravy Smile You good at coding?
Some of what you want maybe met by http://forum.kodi.tv/showthread.php?tid=224794 if it ever gets to a state it can be included in official builds, unfortunately it has a long and difficult history so may not be ready for some time yet.
I've yet to read the referenced links in previous posts but will do asap as i may learn something but for now hopefully i'm not repeating anything perviously suggested.

I would like a solution where the Filter feature is expanded to include more than just the current offerings of Title, Ratings, My ratings, In Progress, Year, Tags, Genre, Actor, Director or Studio as is the case today.
I would also like to see the Filter feature become persistent between sessions much like the View option is today.

In that way, for example, when i next jump into Movies i would see the filtered library according to previous filter settings for Movies.
Obviously, some form of visual queue would be required so as to indicate to the user that a filtered library is actually presented.
For example, this visual queue could simply be "Video - Filtered Titles" in the top left rather than "Videos - Titles" as is the case today.

With this in mind, being able to filter according to new options like Source, Audio type (DTS, Dolby, etc), Audio channels (2.0, 5.1, etc), Video Resolution (SD, HD, FHD, UHD, etc or even DVD, BD, UBD, etc), Encoding type (Mpeg, VC-1, H.264, H.265, etc) or some subset or superset could be rather useful.

Too many times i want to view a SyFy movie with 7.1 DTS sound and there is no easy way to find them Confused

Upon startup, Kodi could even auto apply a Source Filter to the library view that is presented to the use. As such Movies contained on unavailable sources would be filtered out of view which would resolve the OP's concern.
Such an auto Source Filter could be turned on/off via an option within Media Settings – Video Library.

To go in-hand with an expanded Filter mechanism, it would be great if Kodi could provide a pop-up to request the user check that a source is connected and powered on when a play attempt is performed on some Movie contained on an unavailable source.
As it stands today, i'm too often presented with an option to delete a movie just because i didn't turn on the HDD power supply or for some reason the HDD wasn't auto mounted by the OS (if it was indeed powered on).

In reality, i find this pop-up to individually delete a movie during a play attempt due to the file no longer being available a little pointless.
Either a user has done a clean-up of his movie files via lots of file deletes on his HDD's or a specific HDD is not currently connected to Kodi BUT Kodi should be able to determine which case it is.
If the source is not accessible then a pop-up to check the source may be more appropriate whereas if source is accessible but a file is not, then a pop-up to clean library may be more relevant (as there will likely be more dead entries in the DB).

No software is perfect and what i find a useful feature, others may find frustrating or wrong so take all the above with a grain of salt.

Hopefully it's some food for thought or inspiration of sorts to those able to code within Kodi Tongue
I have some coding knowledge but i don't think ist enough to implement this.
There are a few parts thats need to be changed:

- At Startup check and save which source is available
- Read and flag the library (how is it flagged?), depending on how the lib is read now this might be done with a SQL query
- modify skin, i think there is currently no design to Show flagged items as "greyed out"

- How to handle last added items if the source is unavailable? (I think in this case it should be hidden even if greyed out is selected as Option)

Hot pluggin:
reinitialize the library if a source is connected or disconneted


I like the idea of using the already existing filter infrastructure. This should make implementation a lot more easy BUT i don't think ist possible to achieve that some items are displayed as greyed out.

Quote:In reality, i find this pop-up to individually delete a movie during a play attempt due to the file no longer being available a little pointless.
Either a user has done a clean-up of his movie files via lots of file deletes on his HDD's or a specific HDD is not currently connected to Kodi BUT Kodi should be able to determine which case it is.
If the source is not accessible then a pop-up to check the source may be more appropriate whereas if source is accessible but a file is not, then a pop-up to clean library may be more relevant (as there will likely be more dead entries in the DB).

Fully agree to this. The message is only useful if the source is available but the specific file is missing.
Yeah i'd think there is a bit to do but to show inaccessable items as 'grayed out' would be going in the wrong direction. After all why would one want to flip through possibly pages of inaccessable items?

I don't know how a library view is generated but if it's done by sql queries then a simpler approach of filtering inaccessable items may even be a relatively simple adjustment to the query command that builds and presents info to the skin (if it works that way).

Some changes to handle hot plugging are os related so that adds some complexity but restarts are quick on some platforms (eg. RPi) so hot plugging may not be so urgent ot important.

Me, I'm not famiar with Kodi code or sql commands so doubt i can make any changes that would work let alone be accepted as a pull request. Happy to test stuff though Smile