gordonjb / cagent Goto Github PK
View Code? Open in Web Editor NEWCAGEnt is a Plex metadata agent for the wrestling database CAGEMATCH.net.
CAGEnt is a Plex metadata agent for the wrestling database CAGEMATCH.net.
Can we generate show/match posters? Poster with text, old style? Include logo?
This should also include matchup images, which are often landscape or other non poster dimensions. We could load these and convert them to a poster format, for instance resized in centre with a blur behind
Seems like it should be doable! This should be optional tho
This works! Add some code to parse through the first x reviews on a result page and add them like this:
metadata.reviews.clear()
r = metadata.reviews.new()
r.author = 'Lightwalker19'
r.source = 'CAGEMATCH inmate'
r.link = 'https://www.cagematch.net/?id=1&nr=195471&page=99'
r.text = "One of the worst wrestling shows I've ever seen in my whole life. I've never ever seen so much garbage booking on one night. The only positive thing I can say about this show is: Well, it isn't the worst Wrestlemania of all time, because Wrestlemania 27, 9 and 11 exist. But let's get step by step: Dumb and unfunny beginning with Alexa and Hogan, dull way of crowning Rollins. AJ vs Orton being the only good match of the night but a standard one for their habilities. Time-wasted by watching filer matches like Miz vs Shane, Balor vs Lashley, Corbin vs Angle and Roman vs Drew matches. I don't like Kofi vs Bryan match, Sorry if you liked, but Kofi's crowning felt like the most anti-natural and forced title victory I've ever did remember. Batista vs HHH, a possible cure for someone's insomnia. Disappointing and boring Main event, and in the top of it all: A botched finish, This show was painful to watch. And I have to mention the no-wrestling segments? Dear Lord, the creative side of WWE was on its lowest point that night. Maybe the only good promo of the night wasCena's comeback as Dr. Thuganomics. But for a pointless propose. Uff, I need to rest a little. I never been so angry talking about a Wrestlemania show. Well, like I said, maybe back then at 2011, when Wrestlemania 27 was happening."
This would be handy for matchup images, which are often landscape or other non poster dimensions. We could load these and convert them to a poster format.
We import a bunch of crap right now, could this be made simpler? Is it too heavy?
I tried matching a match using the 0 id function (cm-id:300948:0
), and selected the correct match. This had the following issues:
Can we support either only allowing reviews in a specified language, or a list of languages to filter out when adding reviews?
Could use Mimino666/langdetect?
Seems like there are two main methods we need to implement, search and update.
search()
seems to be the method to figure out candidates for matching. We need to set a results array of MetadataSearchResult
objects (internal Plex class I guess), this is done with this info:
results.Append(
MetadataSearchResult(
id = id2,
name = id2,
year = 2017,
score = 99,
lang = lang
)
)
We're implementing two types of search, ID matching and DB search. ID matching will occur if the search string contains cm-id:xxxx
, where xxxx will be interpreted as the event ID in Cagematch. Score can be set to 100 for ID matches. We'll then need to look up that ID page to get the remaining info.
DB search will use urls to perform a search of the events database. We should be able to populate all the results info from the search page.
update()
seems to actually set the metadata. I assume Plex will decide which result is passed in based on the score from the candidates returned from search for automatching, and the user will decide for Fix Match.
metadata.id
contains the id being matched for looking up info.
How should score for search results be calculated?
Search page results contained in <div class "Table">
Contains
<div class="TableHeaderOff" id="TableHeader">
which has some brief text indicating total number of results displayed and available. May be useful in future.<div class="TableContents"><table class="TBase TableBorderColor">
contains the actual tablethe tr
table rows have classes, TRowTVShow
, TRowPayPerView
, TRowCard
For instance, if it's going into a collection, you might not want the name in the title, for instance in a ROH collection, you might want items inside the collection to be "Manhattan Mayhem" and "Final Battle 2005" instead of "ROH Manhattan Mayhem" and "ROH Final Battle 2005"
As to how we do this, it might involve looking up the short name from the promotion page. Maybe this info could be cached? Or we just hold a config file or something with a bunch of these pre programmed? We'll never get them all tho...
We have a bunch of keys for info that we're using to fill out a format string to build a description anyway. Why not allow overwriting that string?
Card/Results will still probably be a pain point, as they're separate webpages. I think maybe a $cardOrResults key and then which appears is still controlled by the setting.
The more we add new page requests for features, the more lookups we're doing, and the more repeated lookups of the same info we're doing.
Should cache pages/info, at least for a short time.
Cagematch has a DVD database, we should support matching DVD's against this database
Install command?
pip install -r requirements.txt -t Cagent.bundle/Contents/Libraries/Shared
After so much messing with packaging options and trying to download deps manually, it was as easy as
pip install -t Cagent.bundle/Contents/Libraries/Shared/ --no-compile --no-binary=:all requests beautifulsoup4 fuzzywuzzy
pip freeze --path Cagent.bundle/Contents/Libraries/Shared/ > requirements.txt
Supporting ID matches is most important, that way people can name their files however they like and still resolve using Fix Match in Plex. However, improving automatic matching would be good. The initial set of formats is very geared to the way my files are sorted, so if we can make it work for others too we should.
I may have overestimated the granularity an agent offers (seems we only get a stripped filename), but may still be doable.
As it turns out, agents don't deal with this, scrapers do. We're using the movie scraper, and hopefully that'll be sufficient. We do some regex matching of the expected format in the agent, will have to document this.
Currently, ID matching expects the string to start and end with the ID, so it only works for searches. I imagine this is because the Plex scanner will pick out known IDs, where as our format is not known to the scanner.
Can we use the ID in a filename for automatching? Can we figure out a correct format, or parse the filename?
Will need to disable match id 0 functionality for automated searches.
Currently to test, I'm just using a mounted network volume with some of my actual files in to test against.
Should be replaced with some replicable way of creating a test structure
Allow the user to select which card information should be included in the description: the card, the results, or no info.
The default should be the card.
Currently only match against events using cm-id:xxxxx
Can we also support matching against DVD's and matches in this way?
Perhaps cm-dvd:xxxx
and cm-id:xxxx:x
(e.g. match 7 on event 1234 is cm-id:1234:7
)?
Currently dates are used in two places.
metadata.originally_available_at
is set to the "Broadcast date" entry if there is one in event info, and the "Date" if not, as this is always present.
The problem here will always be that this approach is right for some events and wrong for others (not to mention that this distinction is entirely subjective).
For instance, a taped AEW show that was taped on 11.03.2021 but aired on 17.03.2021, we would want to use the date it was aired. Fairly cut and dry. Although even then, the date used in Cagematch event searches is always the taping date, which can make it hard to match a taped event.
However as an alternate, a Big Japan show which took place on 20.06.2018 then ended up aired on TV on 30.06.2018 feels like a different case to me. It wasn't so much a taped for TV match as a match that happened to air.
I think broadcast by default is probably the right way to go. but maybe we can check if the search string/filename contains a date, and if it matches either the broadcast or tape date, go with that as that's the user expressing a clear preference.
Can reuse the translation code from graplist.fm
Format:
Movies
└─── [Promotion] - [yyyy-mm-dd] - M - [Name].ext
Will probably need to do some sort of fuzzy matching on the card. We can use the promotion and date to get a list of candidate events, then we'll need to run down the cards until we find a match
This can't ever be perfect I don't think without using event ids and match numbers, there will undoubtedly be cases where the same people had the same match for the same promotion twice in one day, on the same show and on different shows. But we can make a guess. All we'd be matching in this case anyway is some simple metadata like the event name, promotion + venue so we can stick it in the description, and maybe some cast info. I don't see too much fuss being made if we're not 100% accurate.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.