Closed gb160 closed 9 years ago
Can you make a PR from my latest changes on the addon, and then reapply your changes and make a new PR? Right now if I apply directly your PR it will revert my latest changes.
Didn't understood what you mean with: "The only problem that i can see is if you haven't renamed any strm files from how the addon creates them initially, then they should work fine."
if you check your changes they should be fine...i only re-forked it a short while ago.
when adding to the library,the xbmc scraper sometimes doesn't pick up movies with the .strm filename that they're given by the addon....these have to be manually renamed to get xbmc to add them to the library. Ive only had this a couple of times with movies and a couple of times with tv series. The reason why i mention it is because fanart won't be displayed for these files....they will play fine, just no art/metadata.
the reason they fail to get fanart is (i think) because the .strm file has to be named with the name given at the end of the url in the .strm file
ill try to figure out a workaround, but the VAST majority will work with fanart.
Yes, the .strm file should have the full name of the movie plus year of release to get better results.
I will check your fork, because this PR still deletes my latest changes ;)
Ok...if the naming could be exactly the same format every time, then it would match every time, and you'd get fan art everytime
Do u want me to re fork and apply my changes again?
Sent from my iPad
On 20 Jun 2015, at 18:19, Carlos C. notifications@github.com wrote:
I will check your fork, because this PR still deletes my latest changes ;)
— Reply to this email directly or view it on GitHub.
I will check your changes and then apply your code ;) probably will take more time ;)
Ok cool....you'll notice I made a slight change with the resume function, mainly that playback has to be passed 5% or the resume point is deleted, this mimics how resume points are created natively by XBMC, .....also I noticed that resume points weren't being deleted when the movie/episode was watched until the end, so I commented out 'and self.isPlayingVideo()' ...which resolved this issue for me. I've tested my changes extensively last night ....all working well.
OK, will se if I check the code at night.
Im not liking very much this change. This only works when the strm file has the Year at the end, otherwise you will not get any info.
As i said, if the naming format was uniform every time, there would be no failures. tbh the VAST majority of movies that I've added so far from the addon are already in this format, and the ones that aren't i always rename anyway.
I understand your concerns if u don't want to adopt this approach, but having widget artwork/watched/resume is a must have IMO.
Its very similar to the way Genesis implements the widget artwork, but because the file naming ALWAYS ends with a year in Genesis, it never fails.
Can you research a way of json get all movies and then search for the keyword? If year isn't present on title? Because you first search for the year or year-1 or year+1 but if year isn't there you will get an except and look for TV show. Also Portuguese titles, plots, etc will need .encode('utf-8') otherwise will fallback to the except part.
I've just managed to get it working on films with no year in the title....Ive no more time now to work on it now but I'm confident over the next couple of days I can solve this completely. leave it with me ;)
Ok I will investigate the SMB problem ;)
I've changed the approach slightly so that the year isn't used in the Json search anymore, it seems much more flexible now. My only problem is with the encodings.....I've tried what you suggested and used .encode('utf-8') but on certain films I'm still getting unicode errors , so I'm not sure I understood what you suggested. An example of this is 'One Flew Over the Cuckoos Nest' ....the director name has a character that seems to cause this error.I take it this is the same problem that anything Portuguese will cause as well?
Can u offer some assistance with this? Once this is solved I'll make a new PR (I'll fork from your latest version lol)
When it fails the error in the log is this... UnicodeEncodeError: 'ascii' codec can't encode character u'\u0161' in position 4: ordinal not in range(128)
The first 2 of these lines of code work ok, i see the data get printed to the log, but the 3rd line is where it fails..
meta = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "VideoLibrary.GetMovies", "params": {"filter": {"field": "path", "operator": "contains", "value": "%s"}, "properties" : ["title", "originaltitle", "year", "genre", "studio", "country", "runtime", "rating", "votes", "mpaa", "director", "writer", "plot", "plotoutline", "tagline", "thumbnail", "file"]}, "id": 1}' % title)
print str(meta)
meta = unicode(meta, 'utf-8', errors='ignore')
edit:ignore the indent, this forum seems to have applied it.
were you have selfmeta['X'] try selfmeta['X'].encode('utf-8') on the places were you can have portuguese chars.
like selfmeta['title'],selfmeta['plot'],etc
Ok, understood. just tried that and now im getting the error... 'Int object has no attribute encode' .....grrrrr.
I think I only get one of those if I try to encode a integer variable.
BINGO!!! ITS WORKING!!! Thanks for the assistance, I'll test it for a while and clean up my code before I make a PR tonight.
Can u suggest some Portuguese films/tv series that I can add to my library to test this thoroughly?
If you have the scrapper setup to portuguese, and kodi is in portuguese. Almost all movies will resolve to portuguese on plot, title and genre, so you can test with almost any movie or tvshow.
When you make a new PR, have in mind that probably my code is already more advanced than your fork ;)
http://abelhas.pt/Pedro.Seixal/Filmes+Portugueses/*e2*96*baFilmes+Portugueses
But what @Mafarricos sayed is correct.
Understood, my changes should be simple to apply to the new version.
As portuguese movies to be recognized to english I don't know if they have to be in the international title.
if both the titles are on IMDB database (international and national), the scrapper will find them both in either way.
The only problem that i can see is if you haven't renamed any strm files from how the addon creates them initially, then they should work fine. Unfortunately the xbmc scraper won't match certain films/tv series from the name that they are given when the .strm files are created, so any files you've manually renamed to get xbmc to recognise, will be played as they were before.