First off, thank you for this great utility, I am loving the AMC script, and have used it as a base for a custom version that suits my needs.
What I am trying to do: Save the label and tracker that is passed from the client to the AMC script as a new xattr for use later.
A bit of background: I recently lost all my hardlinks when I migrated from separate volumes to one large, spanned volume. My library contains a mixture of TV, Movies, eBooks, Music, Comics, ect. Each is sorted into it's own folder based on the tracker it came from, or the label it was assigned.
When I went to run my manual filebot run script, it obviously doesn't have these being passed to it, so it had to rely on existing xattr and online lookups for the content.
This worked decent for the movies and TV shows, but obviously failed / mismatched for the other categories. So I thought, if I could save these as xattr, and then modify the script to look these up, I won't have to worry about this in the future.
Now I will be the first to say I'm not fluent in groovy, and some of your backend code goes way over my head, but for the most part I have been figuring out how to do things on my own, and it's been working (maybe not as elegant as if you had written it, but it's functional).
After a good 5 hours of playing around, I think I'm close, but I'm just not quite sure what I'm doing... Here is the code I'm using:
Code: Select all
// group episodes/movies and rename according to Plex standards
def groups = input.groupBy{ f ->
// print xattr metadata
if (f.metadata) {
log.finest "xattr: [$f.name] => [$f.metadata]"
}
tryLogCatch {
if (fromUT) {
Resource<MetaAttributes> xattr = Resource.lazy(xattr(f)); // Attempt 1
// def xattr = new MetaAttributeView(f); // Attempt 2
String UT_LABEL_KEY = "net.filebot.ut.label";
String UT_TRACKER_KEY = "net.filebot.ut.tracker";
if (tracker != null && tracker.length() > 0) {
xattr.get().setExtraMeta(UT_TRACKER_KEY, tracker);
}
if (label != null && label.length() > 0) {
xattr.get().setExtraMeta(UT_LABEL_KEY, label);
}
}
}
I have gotten it narrowed down to:
Code: Select all
No signature of method: net.filebot.media.XattrMetaInfo.call() is applicable for argument types: (java.io.File) values: [X:\Folder\File-Name.ext]
Using Attempt 2:
I got the following error:
Code: Select all
Could not find which method get() to invoke from this list:
public abstract java.lang.Object java.util.Map#get(java.lang.Object)
public java.lang.Object java.util.Map#get(java.lang.Object, java.lang.Object)
Once again, thanks for the amazing program!
-Ctark