Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wish: kodi plugin #450

Open
airdogvan opened this issue Mar 30, 2024 · 13 comments
Open

Wish: kodi plugin #450

airdogvan opened this issue Mar 30, 2024 · 13 comments
Assignees
Labels
enhancement New feature or request

Comments

@airdogvan
Copy link

Maybe i could look into writing this myself. After watching a movie or episode send update to watcharr.

But apart from that great idea and works very well for me.

Thank you!

@IRHM
Copy link
Member

IRHM commented Mar 30, 2024

Hi, thanks for opening this issue @airdogvan!

I've never used Kodi before, so your guidance on how it should work would be much appreciated.

I suppose the plugin would be downloaded in Kodi by the user, then they would authenticate against Watcharr and the plugin can scrobble watched content automatically?

Do you think auth should be handled via api keys the user can generate in Watcharr: #360 (if you do look into writing this plugin, you could manually grab your real auth token for now, then we could swap it over to use api keys later when implemented if you think that's suitable) - only problem I see is they could be a pain to type out on a TV (not sure if there's an easy way to get around that).

@IRHM IRHM added the enhancement New feature or request label Mar 30, 2024
@airdogvan
Copy link
Author

airdogvan commented Mar 30, 2024 via email

@IRHM
Copy link
Member

IRHM commented Mar 30, 2024

That's great @airdogvan, thank you for taking the time.

If you are able to get the base functionality (scrobbling) working, I can look into how we could handle the auth a little easier (the token thing you mention sounds good, the user could probably create a one time small token to grant access to the kodi plugin).

For the watched content, is that referring to syncing watched history from kodi to Watcharr?

Not sure where the best place to put it would be, I think you could make a plugins/kodi folder in the main repo?

Thanks again! Let me know if you run into any problems.

@airdogvan
Copy link
Author

@ IRHM I've found an addon that already does the heavy lifting script.myepisodes and am seriously thinking of using that as a solid base.

Authentication could be done easily in the settings once the user has generated her/his API key.

Tell you the truth, until some form of API implemented not much I can do for the moment. I'll use the time getting familiar with the existing code and wait for further progress. Unless of course you have other suggestions.

@IRHM
Copy link
Member

IRHM commented Mar 30, 2024

Sounds good @airdogvan, will hopefully get api keys fully done at some point.

As long as the kodi plugin can get a TMDB content id, then it should work to add content against the current Watcharr api by making a post request to /api/watched (routes.go:352).

Hopefully Kodi is able to give us the TMDB id, otherwise we may need to make other changes to support whatever ids it does have.

@airdogvan
Copy link
Author

cannot give you a 100% guarantee but Kodi's been around for a while so I would be very surprised that it doesn't handle TMDB.

@hernandito
Copy link

+1 request for Kodi support. I would love to ditch Trakr..... I hate that my library is out there for everyone to see.

Kodi does have a comprehensive API... I would imagine one can get list of watched items.

@airdogvan
Copy link
Author

airdogvan commented Apr 11, 2024 via email

@IRHM
Copy link
Member

IRHM commented Apr 12, 2024

Hey @airdogvan, yep just the TMDB ID and content type should be good enough.

You can make a POST request to /api/watched with a body following this schema:

I've simplified a struct from the code to make it easier to quickly reference:

type WatchedAddRequest struct {
	status?: WatchedStatus;
	rating?: int8;
	thoughts?: string;
	contentId: int;
	contentType: "movie" | "tv";
	// Pass a watched date and we will set the CreatedAt (and initial UpdatedAt)
	// properties for this watched entry to this specific date.
	watchedDate?: time.Time;
}

The contentId must be set to a tmdbId and the contentType must be set to movie or tv. All the other parameters or optional.

An example of adding a tv show (Upright) as watched could look like this (request body):

{"contentId":95913,"contentType":"tv","status":"FINISHED"}

I should probably look into generating api docs to help out with anyone needing anything like this. For now, you can half reverse engineer by performing an action in the browser, then looking in your dev tools network tab and seeing what requests it made to the server (or feel free to ask me here, I don't mind helping out!).

Thanks! Let me know if you need anything else!

@sbondCo sbondCo deleted a comment from airdogvan Apr 12, 2024
@IRHM
Copy link
Member

IRHM commented Apr 12, 2024

Hey @airdogvan, I don't have telegram, but we do have a public matrix server (https://matrix.to/#/#watcharr:matrix.org) we could talk in or you can pm me: @IRHM:matrix.org

@airdogvan
Copy link
Author

sent you a DM but says profile doesn't exist...

@IRHM
Copy link
Member

IRHM commented Apr 13, 2024

sent you a DM but says profile doesn't exist...

My username might have to be all lowercase, github looks to have uppercased it to @ this gh account.

You can join the Watcharr matrix space if that doesnt work and ping me from there.

@IRHM
Copy link
Member

IRHM commented Jun 27, 2024

Thanks to @airdogvan we now have a kodi plugin in beta: https://github.com/airdogvan/watcharr_kodi

You can download the first beta version from the release: https://github.com/airdogvan/watcharr_kodi/releases/tag/beta (direct download).

I personally don't use kodi so my feedback probably doesn't matter, but if anyone tries this out please tell us about your experience! I'm sure @airdogvan would be happy to hear what you have to say!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: In Progress
Development

No branches or pull requests

3 participants