#Working with Collections
1 messages · Page 1 of 1 (latest)
Welcome @outer yacht!
Someone from <@&938443185347244033> will assist when they're available.
Including meta.log from the beginning is a huge help. Type !logs for more information.
After attaching your log, do not forget to hit the green check boxes when prompted by our bot.
You can press the "Close Post" button above or type /close at any time to close this post.
collections:
# -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
# Seasonal
# Summary: Seasonal and Holiday
# -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
Seasonal:
imdb_list:
- https://www.imdb.com/list/ls040154031/
trakt_list:
- https://trakt.tv/users/del74/lists/christmas-movies
- https://trakt.tv/users/pauls67/lists/christmas-movies
- https://trakt.tv/users/johnthebarber/lists/christmas-movies
- https://trakt.tv/users/cinhd/lists/christmas-movies
filters:
title.not:
- "Iron Man"
- "Little Women (1994) {tmdb-9587}"
- "The Changeling (1980) {tmdb-13550}"
- "Harry Potter and the Philosopher's Stone (2001) {tmdb-671}"
- "Willy Wonka & the Chocolate Factory (1971) {tmdb-252}"
- "Richard Pryor - Here and Now (1983) {tmdb-21921}"
- "Bridget Jones's Diary (2001) {tmdb-634}"
- "Eyes Wide Shut (1999) {tmdb-345}"
- "Iron Man (2008) {tmdb-1726}"
- "Little Women (1994) {tmdb-9587}"
- "The Changeling (1980) {tmdb-13550}"
- "Harry Potter and the Philosopher's Stone (2001) {tmdb-671}"
- "Willy Wonka & the Chocolate Factory (1971) {tmdb-252}"
- "Richard Pryor - Here and Now (1983) {tmdb-21921}"
- "Bridget Jones's Diary (2001) {tmdb-634}"
- "Eyes Wide Shut (1999) {tmdb-345}"
sort_title: "!000_Seasonal"
collection_order: random
sync_mode: sync
summary: "Christmas and Seasonal Movies"
schedule: range(11/01-01/09)
visible_home: range(11/01-01/09)
visible_shared: range(11/01-01/09)
delete_not_scheduled: true
Also.. at the bottom of the collection there's some additional section called "Movies in Seasonal Collection" that shouldn't be there. No idea how that got there, but the pink panther christmas movie should be included in the top.
That's a collection with the same name in another library. Plex is putting it there.
What are those questions?
I see this now. I can take that out and I know why pink panther isn't there.
Is this the correct way to filter out movies I don't wnat in the list?
It seems unlikely that "Little Women (1994) {tmdb-9587}" is the title of a movie in Plex.
correct. i am mixing tmm stuff with plex. i removed that.
That seems like part of the file path.
In which case you could try
filters:
filepath.not:
- "Little Women (1994) {tmdb-9587}"
It's one way to do that, sure. Filters are more expensive than doing it in the builder, however, so depending on how many titles are in all those lists, the filtering could take a while.
ok ill check out the builder
the "builder" is something like "trakt_list" in your case.
If you created your own list that didn't include any of the movies you don't want, then there would be no filtering required, which will always be faster, and more precise.
Another option would be to give these "never-in-christmas-collections" movies a label and filter on that label. Then you can add movies to the exclusion list by adding a label.
ok i'll check that out. next question.. i have some movies that aren't in the imdb/tmdb i want to add to the list. can I just use another filter for these? i guess the builder approach would solve this too.
If you want to add titles you could:
- create a list with just those titles, add that list to the collection
- use
tmdb_movieor the like to add them - merge all these lists plus your new titles and minus the ones above into one giant "dungeonmaster's christmas collection" list on IMDB or something and use that one list to drive the collection.
probably something else as well; there is no one true answer
ok will try it
antwanchild used !aenh
@outer yacht, anything else needed here? If not, please type /close and hit enter. Please respond within 24 hours of this message or it will be archived.
I think I got this working. However, my collection shows under collections, but I also want it to show in the Library as the first item before all of the movies on the dates specified. I don't see it there.
You need to set the collection mode and sort title to put it there.
my sort titles are default sorts !000_Top250, and then I have them grouped by !001_Collection, !002_Collections, !003_Collection
I have for my seasonal collection:
sort_title: "!001_Seasonal"
collection_order: title.asc
collection_mode: show_items
visible_library_top: range(11/01-01/09)
visible_home: range(11/01-01/09)
visible_shared: range(11/01-01/09)
That's not what it shows above. do you have a log showing this happening?
collections:
# -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
# Seasonal
# Summary: Seasonal and Holiday
# -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
Seasonal:
imdb_list:
- https://www.imdb.com/list/ls040154031/
trakt_list:
- https://trakt.tv/users/del74/lists/christmas-movies
- https://trakt.tv/users/pauls67/lists/christmas-movies
- https://trakt.tv/users/johnthebarber/lists/christmas-movies
- https://trakt.tv/users/cinhd/lists/christmas-movies
filters:
title.not:
- "A Charlie Brown Valentine"
- "Be My Valentine, Charlie Brown"
plex_search:
any:
title:
- "Gumby's Christmas Capers"
- "Happy New Year, Charlie Brown"
sort_title: "!001_Seasonal"
collection_order: title.asc
collection_mode: show_items
sync_mode: append
summary: "Christmas and Seasonal Movies"
schedule: range(11/01-01/09)
visible_library_top: range(11/01-01/09)
visible_home: range(11/01-01/09)
visible_shared: range(11/01-01/09)
delete_not_scheduled: true
this is what I am using now..
Will need to see a log of this happening.
i do see this in the log "| Collection Error: visible_library_top attribute not supported "
Yeah, that's not a valid attribute. It's a template variable for one of the defaults.
The log will show exactly what's going on, but if you don't want to provide it there's not much anyone here can do.
I have no issues sending a log when necessary, but this was such a minor thing. I used visible_library: range(11/01-01/09) and it worked.
chazlarson used !aenh
@outer yacht, anything else needed here? If not, please type /close and hit enter. Please respond within 24 hours of this message or it will be archived.
Can a collection be deleted from the command line? I have just one I'd like to delete.
What command line?
Collections are defined in the Plex database, so it's not clear what command line you would be using to delete one collection. It would be simplest to just click delete in the UI.
Gotcha. I had read somewhere (in a sample config i think) that deleting from the UI would retain some Kometa info and wasn't advised. Not sure.
--delete-collections was the cli argument i saw
Is there a way to show the collection in collections all the time, but only schedule visibility fro specific libraries?
Those are two different things.
If you want to prevent Kometa from creating a collection, you need to remove whatever is creating that collection from the config or it will just keep coming back.
If you have done that, and want to clean up that one random collection from Plex, it's simplest to just delete it in the UI.
If you want to delete the collection to force Kometa to create it again, do it in the UI if it's a small number or use --delete-collections if you want to delete ALL the collections in each library before the run.
Is there a way to show the collection in collections all the time
All collections are always visible in the collections tab. They cannot be hidden from there.
Ok. I'll check that. I had a Halloween collection disappear, and I thought it might be because of the date range.
It is; the default seasonal collections are all created and destroyed on a schedule. If you don't want that to happen, turn it off.
I'm not using the defaults. I have defined my own.
In your collection above:
schedule: range(11/01-01/09)
visible_library_top: range(11/01-01/09)
visible_home: range(11/01-01/09)
visible_shared: range(11/01-01/09)
delete_not_scheduled: true
You are telling Kometa:
Process this collection only during this date range:
schedule: range(11/01-01/09)
Make it visible in these places during these date ranges:
visible_library: range(11/01-01/09)
visible_home: range(11/01-01/09)
visible_shared: range(11/01-01/09)
If we are outside the schedule: range(11/01-01/09), delete this collection:
delete_not_scheduled: true
So, on January 10, this "Seasonal" collection will get deleted from Plex, to reappear on November 1
I imagine your Halloween collection is similar and is doing as you have requested.
Without the definition or a log of it happening, that's my best guess.
I don't understand this:
but only schedule visibility fro specific libraries?
A given collection is defined within a specific library. You can only control that collection's visibility in that one library, singular. You can't control a single collection's visibility in multiple libraries, plural.
If a collection exists, you can schedule its visibility independently however you want, within it's parent library.
If a collection exists, it will be visible in the collection tab; you can't remove it from there or schedule it's visibility there.
If a collection does not exist, it will not be visible in the collections tab and you cannot control its visibility anywhere.
If a collection definition includes these two lines:
schedule: SOME_SCHEDULE
delete_not_scheduled: true
Then Kometa will create/update it on every run during SOME_SCHEDULE and delete it [if it exists] on every run outside SOME_SCHEDULE
If you want it visible in the collections tab outside SOME_SCHEDULE, remove the second line.
If you want it to get created/updated outside SOME_SCHEDULE, remove both lines.
ok im testing..
got it. the schedule option was the culprit and is independent of the visibility settings.
the things we do for movie poster..
Not sure what this has to do with posters, but it sounds like it was behaving as configured.
haha.. collections, posters, etc.. it's all just for display.. the reference being all the work we put into learning something just to show a movie poster in a specific place
i doubt.. but would be cool to be able to rotate the collection poster randomly between a few different ones.
You could certainly set up a script to swap asset images around and Kometa would just pick them up.
of course.. but it would be easier if kometa did it.
Except then the config would get more complicated while the script would be a single set-and-forget
I wouldn't call it convoluted, but it's already a bit to wrap your head around. a quick poster_random: t/f wouldn't hurt.
probly 1 line of code on the backend?
random from where?
some directory? Some set of URLs? Some set of random file paths?
file_poster: config/assets/Posters/Category/Christmas01.png
#file_poster: config/assets/Posters/Category/Christmas01.webp
#file_poster: config/assets/Posters/Category/Christmas01.webp
just pick random from the defined lines
Kometa never sees those last two lines.
its an example.. lol
file_poster: config/assets/Posters/Category/Christmas02.webp
file_poster: config/assets/Posters/Category/Christmas03.webp
You must be the main architect of Kometa
Right, and that's not valid YAML, so you need to do something like:
file_poster:
- config/assets/Posters/Category/Christmas01.png
- config/assets/Posters/Category/Christmas02.webp
- config/assets/Posters/Category/Christmas03.webp
and there's now code to fall back to only the first in case random is turned off, and deal with what happens when the random pick doesn't work, or the URLs fail, or whatever else.
It's not a trivial add to make sure it works correctly.
Nope, just a random software engineer.
yeah it would take some work beyond a quick stab at the codebase.. but I don't see it being too complex.. maybe an hour or two. in any case.. just an idea!
Store your alternates in the asset directory as:
assets:
Whatever_Collection:
poster-01.png
poster-02.webp
poster-03.jpg
poster-04.jpeg
...
Then run this script from the config directory whenever you want to randomize the posters:
import os
import random
import shutil
def set_random_poster(directory_path="config/assets"):
TARGET_EXTENSIONS = ('.png', '.jpg', '.jpeg', '.webp')
BASE_FILENAME = "poster" # The new base name for the random file
for root, dirs, files in os.walk(directory_path):
poster_files = []
for f in files:
if f.lower().startswith("poster-"):
_, ext = os.path.splitext(f.lower())
if ext in TARGET_EXTENSIONS:
poster_files.append(f)
if poster_files:
source_path = os.path.join(root, random.choice(poster_files))
_, source_ext = os.path.splitext(source_filename)
destination_path = os.path.join(root, f"{BASE_FILENAME}{source_ext}")
try:
shutil.copy2(source_path, destination_path)
print(f"Copied **{source_filename}** to **{destination_filename}** in {root}")
except Exception as e:
print(f"An error occurred while copying in {root}: {e}")
if root == directory_path:
dirs[:] = [d for d in dirs]
else:
dirs[:] = []
if __name__ == "__main__":
set_random_poster()
That looks like AI code
did you test it?
visible_library: range(10/01-11/01)
visible_home: range(10/01-11/01)
visible_shared: range(10/01-11/01)
this one is still showing in the library
Reviewed it, it looked fine, didn't go much beyond that. Offered with no warranty; it's probably worth what you're paying for it. 😉
Not sure why based on that, the log would show exactly what Kometa's doing.
I'm able to reproduce it; apparently some logic error. Perhaps open a github issue with a log and details.
does the server have plex pass?
I do have plex pass
I also have plex pass and have seen issues with changing visibility on existing collections for a long time. I don't do any of it though so haven't put a great amount of time into it.
So I'll need to delete the collection and run the collection to get it back in collections but not in library?
Perhaps.
It just reappeared in both collections and the library. I commented out
#visible_library: range(10/01-11/01)
#visible_home: range(10/01-11/01)
#visible_shared: range(10/01-11/01)
and it made no difference. still reappeared
Ok. No worries. Just checking
Commenting out the visibility, then of course the collections will appear
So would be good to open a GitHub issue
ok, let me fix that and try again.
If there are no visibility settings on the collection itself, then the library's settings apply.
If I reference the same collection.yml from two different libraries, can I have specific collections show per library? Or do I need to create a custom yml for each library?
If you want different collections to behave differently per library, then setup separate collections files and call the applicable yml file for the specific library
ok will do.
i want the collections to be the same, just want the visibility and ordering tweaked per library
Then those aren't the same collections, and you will need separate yaml per library.
Is there any validity to this I see in an example config?
operations:
delete_collections: ##### IF YOUR COLLECTIONS SHOW DUPLICATES OR RUN THIS ONCE AND THEN DISABLE FOR A FRESH COLLECTION START.
configured: false ##### DO NOT MANUALLY DELETE COLLECTIONS BECAUSE THE "TAGS" Kometa ASSIGNS WILL STILL BE ATTACHED TO SHOWS
managed: true
What do you mean by "validity"?
It's perfectly valid Kometa YAML.
That will, at the start of each run, delete all collections which were created by Kometa that are not mentioned in the currently running config.
If you want that to happen, put that in your config. If you don't want it to happen, don't put it into your config.
"##### DO NOT MANUALLY DELETE COLLECTIONS BECAUSE THE "TAGS" Kometa ASSIGNS WILL STILL BE ATTACHED TO SHOWS"
this..
And I would have known you were referring to that limited portion of that text how?
Depending on the type of collection, sure, that could happen.
If you create a standard manual collection, the collection is defined by tags on items, and deleting the collection clears the tag, so in that case the claim is not true.
Some smart collections [smart label collections sepcifically] are defined by adding tags and then creating a filter that looks for those tags. In that case, deleting the collection doesn't touch the tag since they are not directly connected.
I've run into some situations where some libraries obey the settings, and some do not. At this point, I don't know if it's a bug or I'm doing something wrong.
Judging from the earlier discourse, and what I'm experiencing, I'm guessing there's some bugs with collection visibility in libraries.
Perhaps.
I’ll throw this in, we still have not seen any log file. So theoretically this is just a guessing game
@devout heart said he reproduced the bug in a test environment. Can we see that log?
The log doesn't contain anything; it just notes no metadata updates required and doesn't touch the collection.
I haven't run it in trace mode or anything or put a debugger on it since I have no particular personal interest in chasing it down.
Also, plenty of other things to occupy my time.
You keep mentioning other issues without producing logs. So we have mentioned the visibility bug and are aware of that. But you say there are “some situations where some libraries obey the settings and some do not” while asking about deleting collections.
I'm as confused as you. lol.. The "some do not" comment was a direct reference to the visibility bug. I'll send a log, but which does it need to be? I've been testing with so many different approaches.. just a library update? operation update? full update? I don't even know if those produce different log output. Which command output specifically do you need to see for the log?
Also.. does this project have any complete example configs to reference? I've been looking at other examples out there and I think things have changed since they were created. I only recall Kometa's (excellent) documentation showing fragments of settings rather than a big picture.
And yes, I titled this "working with collections" because I knew I'd have a myriad of different questions. Sorry if those are getting jammed together.
There's a complete config file example. There are individual examples of the other types of YAML files [collection, overlay, metadata]. It is not possible to produce a "complete" collection/overlay/metadata file example, since there is no fixed point at which a collection/overlay/metadata file is "complete".
What specifically are you looking for in a "complete example config"?
The log is generally the same regardless of the type of run. It reports any runtime flags, contains a redacted copy of the config, and reports all actions taken by Kometa and the result as the run progresses.
Of course, if you are asking about collections, the log will need to be from a run that processed collections, etc.
We ask for a log because it contains all that information and makes troubleshooting simpler since we can review the error summary or look at individual errors in context. It allows reviewing config details in one place. When you upload a log, there are automated log analysis tools that will find common issues.
In an effort to test the "visible_library: range(10/01-11/01)" issue, I ran it with varying parameters enabled/disabled. Do you need to see each one of the logs for when they were enabled or disabled?
The intended function as I understand it is that the collection would be hidden from the library view outside of that date range, but that's not happening. Adding collection_mode: hide removed from both views which is not desired. I want to see it in the collections always, but only in the library if designated directly or by date range.
visible_library: false did not seem to affect it either
so that's three distinct changes in the collection parameters, each producing a different log I'd imagine.
im working on producing the logs for each run. for each test, i run operations with delete_collections to clear then rebuild using -co -rl 'library'
I suspect the log won't contain much since in my case they're the same with or without the visibility settings.
You might try a run with --trace --log-requests to see if that produces anything more.
📝 If you want to review this again, darkstarx1:
:one: Right-click (or long press with phone) on the message that contains the log
:two: Select: Copy Message Link
:three: Use the command: /logscan <message_link> or !logscan <message_link> and paste the value copied from the previous step where you see <message_link> 📝
Author of Linked Message: DungeonMaster
Person who Invoked the Command: DungeonMaster
File Name: meta.log
Table of Contents:
Page 01: User Info
Page 02: Kometa Info
Page 03: Kometa Summary Info
Page 04: Kometa Config.yml YAML Validation ✅
Page 05: Plex Configuration - Section 1
Page 06: Rec 01 - ❌ [ERROR]
Page 07: Rec 02 - ❌⏰ KOMETA SCHEDULED TIME CONFLICT
Page 08: Rec 03 - ⚠️ [WARNING]
Page 09: Rec 04 - 💬 CONVERT WARNING
Yeah, the log doesn't contain anything useful WRT this visibility thing.
It could be that --log-requests would show Kometa asking Plex to set the visibility, which may confirm or deny whether Kometa is trying to do what is requested and Plex is not doing it.
Even that doesn't show anything useful.
collections:
Top Movies of The Week:
mdblist_list: https://mdblist.com/lists/linaspurinis/top-watched-movies-of-the-week
sort_title: "!!"
collection_order: custom
sync_mode: sync
visible_library: range(10/01-11/01)
visible_home: range(10/01-11/01)
visible_shared: range(10/01-11/01)
|====================== Updating Metadata of Top Movies of The Week Collection ======================|
| |
| http://192.168.1.11:32400 "GET /library/collections/62529 HTTP/1.1" 200 562 |
| Collection Metadata Edits |
| http://192.168.1.11:32400 "GET /hubs/sections/1/manage?metadataItemId=62529 HTTP/1.1" 200 90 |
| http://192.168.1.11:32400 "GET /library/collections/62529/children HTTP/1.1" 200 12365 |
Probably needs to be run in a debugger.
It's an annoying bug for sure.
thought i would point out a spelling error, which prevents the update from happening mmass_episode_critic_rating_update
thanks. i copied that from an example and never noticed
another reason why logs can be helpful; just sayin...
antwanchild used !aenh
@outer yacht, anything else needed here? If not, please type /close and hit enter. Please respond within 24 hours of this message or it will be archived.
that error was there, i just never bothered with it because i was trying to figure out the date range issue.
Right. Just saying sometimes people see things that maybe you didn’t.
However, that would been caught by using vscode with the recommended extensions
I'll look into the vscode setup for this, but hopefully i'm out of the woods on most of these issues.
The setup is described at the top of your config.
# We highly recommend using Visual Studio Code with indent-rainbow by
# oderwat extension and YAML by Red Hat extension. Visual Studio Code
# will also leverage the above link (yaml-language-server) to enhance
# Kometa yml edits.