Library.HasContent(Moviesets)
#1
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 ...
Reply
#2
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.
Image
Reply
#3
(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)
Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
Reply
#4
Thanx guys, going to try both suggestions.
Reply
#5
(2012-12-28, 21:09)phil65 Wrote: substring(listitem.folderpath,videodb://1/7/,left)
Just wondering... what does the "left" do?
Image [RELEASE] Metroid
Image [RELEASE] IrcChat
Reply
#6
(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)
Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
Reply
#7
Hah cool, thnx.
Image [RELEASE] Metroid
Image [RELEASE] IrcChat
Reply
#8
It's also quicker, so if you know something has to start from left or right, always use the left/right option.
Image
Reply
#9
(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;
Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
Reply
#10
Then this could be optimized.
Image
Reply

Logout Mark Read Team Forum Stats Members Help
Library.HasContent(Moviesets)0