bpwhelan / EmbyAniSync

Sync Emby anime library to AniList
GNU General Public License v3.0
11 stars 3 forks source link

Possible to add movies as well as shows? #8

Open Suiziide opened 10 months ago

Suiziide commented 10 months ago

First I want to thank you for your work. I have not found anything else that works for what i need for a while, but this script solves everything, and it is now a permanent part of my stack on my server, so thank you and all other contributers who made this possible!

As the title states, I would like it to also sync my movies. I believe this should not be as hard to implement, since there are no need for keeping track of episodes and stuff. I have been looking over the code, but I'm not sure my python skills are sufficient to actually implement it, allthough I might give it a shot if you don't have the time.

Suiziide commented 10 months ago

I did fork it, and made a hacky solution, but it's very yanky and probably not worth a PR. It does work for movies, but should be refactored, and also if for some reason a movie registers as having a season, it throws an exception, but it still works.

billede

If you for some reason want to check it out, it's in my repo

Edit: Yeah something is broken, it only adds watched stuff, and not unwatched seasons or movies. I'll look at it later

bpwhelan commented 10 months ago

Guess default github behavior is to not send me an email when someone opens an issue >.< Sorry for late response.

Hmmm, Yeah I don't think it should be too hard... Just out of curiosity, how do you have your library set up? Movies in a different library or in the same library as other Anime? I haven't really thought about adding movies since logging progress on a movie is obviously much simpler than logging progress on series.

Suiziide commented 10 months ago

I have it set up as movies in a seperate folder and it works fine with just adding the library id to the comma seperated list in the configuration file.

However I'm pretty sure that it would work with either if you just use the item.get('Type') to differentiate between movies and shows. This is how I have made it work in my fork, but I would like to take some time to make it a bit prettier and refactor before I make a pull request.

If you want to implement it yourself, be my guest as well :D

bpwhelan commented 10 months ago

Yeah I was thinking something along those lines. Emby can give us both Series and Movies in the same API call. I havent read through your changes yet but this would make it to where both movie and mixed libraries are supported (in the scheduled update).

On Thu, Nov 9, 2023, 6:54 AM Suiziide @.***> wrote:

I have it set up as movies in a seperate folder and it works fine with just adding the library id to the comma seperated list in the configuration file.

However I'm pretty sure that it would work with either if you just use the item.get('Type') to differentiate between movies and shows. This is how I have made it work in my fork, but I would like to take some time to make it a bit prettier and refactor before I make a pull request.

If you want to implement it yourself, be my guest as well :D

— Reply to this email directly, view it on GitHub https://github.com/bpwhelan/EmbyAniSync/issues/8#issuecomment-1803691352, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB7N5A2HUL53INPEFWDM44LYDTAABAVCNFSM6AAAAAA6KDZHLGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBTGY4TCMZVGI . You are receiving this because you commented.Message ID: @.***>

Suiziide commented 10 months ago

Yeah, I found that it didn't take many changes in the end. My code is very messy and hacky though, but it does the job, so refactoring is not that high of a priority for me :)

bpwhelan commented 10 months ago

It's not really high on my priority list, but I am very welcome to a PR once you feel it's in a good spot. I would also be willing to help review before then if desired.

Suiziide commented 10 months ago

I would love a code review. You are welcome to take a look whenever you have time, it's in my public repo. I did a few minor changes today, but would like for someone else to take a look before i PR

One thing I am very unsure about is the way I handle movies in match_to_emby - I have put in some comments regarding my concerns. (line 195)