adhawkins / SimpleLibraryViews

Logitech Media Server plugin for Simple Library Views
http://adhawkins.github.io/SimpleLibraryViews/
GNU General Public License v3.0
8 stars 2 forks source link

Allow library views to be specified as combinations of other library views #3

Open adhawkins opened 8 years ago

adhawkins commented 8 years ago

It would be useful to be able to specify a library view whose contents were based on other library views.

For example, if I had a library view called 'andy' with my favourite albums, and another called 'audiobooks' that contained my audiobooks, a library view to be used in combination with randmon mixes could be:

andy and not audiobooks

JFritzle commented 1 year ago

I really appreciate and use SimpleLibraryViews. Thank you.

So far, one single library is selected like this: SimpleLibraryView1 Perhaps a combination of several libraries could be selected like that? SimpleLibraryView2

adhawkins commented 1 year ago

I really appreciate and use SimpleLibraryViews. Thank you.

So far, one single library is selected like this: SimpleLibraryView1 Perhaps a combination of several libraries could be selected like that? SimpleLibraryView2

I don't think that would work, as each player can only have a single Library View associated with it. That'd require a change to the server itself, rather than something this plugin could define.

The idea of this issue was to be able to define a library view called 'rock&pop&folk&country' that is a combination of the 'rock&pop' and 'folk&country' views. You would then be able to select this view as the one to apply to a player.

I'd have to have a think how that could be defined in the user interface, and how it could be coded. I'm afraid my Perl skills aren't really up to scratch!

JFritzle commented 1 year ago

Unfortunately, I have no Perl knowledge at all. So I don't know if it's even feasible. But let me explain my idea nevertheless.

Library Views are defined by files [.]simple-library-views-\<library> as before. Library Views are created during the media scan as before. Each player has associated one single Library View, as before. No changes to the server are required.

While currently one single Library View from list of available Library Views can be assigned to player, a new combined Library View is to be created internally and on the fly whenever library selection is changed. This combined Library View is to be assigned to player.

Combined Library View is to be created by simply merging selected and already existing Library Views. After my opinion, this should not cost much time, as directories do not have to get scanned again, but existing library entries have only to be merged together, sorted and duplicates removed. While currently one Library View per player is kept track, an enumeration of selected Library Views per player must kept track.

By the way, it is already possible to define e.g. a library view called rock&pop&folk&country that is a combination of the rock&pop and folk&country views with your existing plugin. Perhaps not as comfortable as in your idea. Creating files .simple-library-views-rock&pop and .simple-library-views-rock&pop&folk&country in parent directory rock&pop and creating files .simple-library-views-folk&country and .simple-library-views-rock&pop&folk&country in parent directory folk&country and adding rock&pop&folk&country to Library View names ... 1 ... then after a media scan I am able to select combined Library View rock&pop&folk&country containing sum of titles from rock&pop and folk&country: 2

But this is not very comfortable when building combinations of serveral libraries. Having n libraries, we have (2*n)-1 possible combinations of 1, 2, 3, ... n libraries. For n=4 libraries rock&pop, folk&country, blues and jazz, we have already (2*4)-1 = 16-1 = 15 possible library combinations. Following your idea to be able to select a combination, it would be necessary to pre-define and create all Library View combinations of previously created single Library Views, a huge effort. Following my idea, desired combination of selected Library Views would be created on demand and on the fly and replaced when library selection is changed.

adhawkins commented 1 year ago

I see what you're saying. You would still end up with a large number of internal views created. For example, if you have 4 views, A, B, C, D. the views created would be:

A B C D A+B A+C A+D B+C B+D C+D A+B+C A+B+D A+C+D B+C+D A+B+C+D

This could soon get unwieldy in the interface where you apply the library view to a player. I'd have to have a think about the logic involved in creating them all also.

Not a bad idea, will have a think.