Kodi Community Forum
Library.HasContent(Moviesets) - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Skinning (https://forum.kodi.tv/forumdisplay.php?fid=12)
+--- Thread: Library.HasContent(Moviesets) (/showthread.php?tid=149868)



Library.HasContent(Moviesets) - butchabay - 2012-12-28

If we want to show a collection case for moviesets we have:
Library.HasContent(Moviesets)

but the collection case returns true for moviesets, tv shows and seasons?

I've tried with:
<value condition="Library.HasContent(Moviesets) | !Container.Content(TVShows) | !Container.Content(Seasons)">extras/flagging/cases/collection.png</value>
<value condition="Container.Content(TVShows) | Container.Content(Seasons)">extras/flagging/cases/TVseries.png</value>

but the collection case is still visible for tvshows and seasons, why ?

Ideas?

Thanx ...


RE: Library.HasContent(Moviesets) - `Black - 2012-12-28

Because your condition is wrong. It has to be Library.HasContent(MovieSets) + !Container.Content(TVShows) + !Container.Content(Seasons). Currently it's true for tv shows and seasons because !Container.Content(TVShows) is true for seasons and !Container.Content(Seasons) is true for tv shows.

Edit: Yes, Container.Content(Sets) makes more sense as Library.HasContent(MovieSets) returns (or should return if it works) true if there are sets in your library. For adding set flags for individual items, use the substring condition in phil65's post.


RE: Library.HasContent(Moviesets) - phil65 - 2012-12-28

(2012-12-28, 20:49)butchabay Wrote: If we want to show a collection case for moviesets we have:
Library.HasContent(Moviesets)

but the collection case returns true for moviesets, tv shows and seasons?

I've tried with:
<value condition="Library.HasContent(Moviesets) | !Container.Content(TVShows) | !Container.Content(Seasons)">extras/flagging/cases/collection.png</value>
<value condition="Container.Content(TVShows) | Container.Content(Seasons)">extras/flagging/cases/TVseries.png</value>

but the collection case is still visible for tvshows and seasons, why ?

Ideas?

Thanx ...

Library.HasContent(moviesets) doesn´t exist afaik (and also doesn´t make too much sense). either container.content(sets) or library.hascontent(movies), or, to detect a movieset item in a movie list, substring(listitem.folderpath,videodb://1/7/,left)


RE: Library.HasContent(Moviesets) - butchabay - 2012-12-28

Thanx guys, going to try both suggestions.


RE: Library.HasContent(Moviesets) - MassIV - 2012-12-31

(2012-12-28, 21:09)phil65 Wrote: substring(listitem.folderpath,videodb://1/7/,left)
Just wondering... what does the "left" do?



RE: Library.HasContent(Moviesets) - phil65 - 2012-12-31

(2012-12-31, 00:58)MassIV Wrote:
(2012-12-28, 21:09)phil65 Wrote: substring(listitem.folderpath,videodb://1/7/,left)
Just wondering... what does the "left" do?

it means that listitem.folderpath has to start with videodb://1/7/.
,right would mean that the info label would have to end with videodb://1/7/ (which does not make any sense in this case of course)


RE: Library.HasContent(Moviesets) - MassIV - 2012-12-31

Hah cool, thnx.


RE: Library.HasContent(Moviesets) - `Black - 2012-12-31

It's also quicker, so if you know something has to start from left or right, always use the left/right option.


RE: Library.HasContent(Moviesets) - phil65 - 2012-12-31

(2012-12-31, 02:41)`Black Wrote: It's also quicker, so if you know something has to start from left or right, always use the left/right option.

doesn´t really matter in terms of performance, it´s always using CStdString.Find()


Code:
if (condition == STRING_STR_LEFT)
            bReturn = label.Find(compare) == 0;
          else if (condition == STRING_STR_RIGHT)
            bReturn = label.Find(compare) == (int)(label.size()-compare.size());
          else
            bReturn = label.Find(compare) > -1;



RE: Library.HasContent(Moviesets) - `Black - 2012-12-31

Then this could be optimized.