amet / service.autosubs

auto run XBMC Subtitles if no subs are found for a movie
GNU General Public License v2.0
20 stars 23 forks source link

Downloading subtitle popus is raised even if subtitles are exists #22

Open georgo opened 10 years ago

georgo commented 10 years ago

Hi, I have TV Show and subtitles next to it, but this plugin always show popup to download subtitles - not only in case I don't have subtitles, but always.

See attached log, hope it helps. http://xbmclogs.com/show.php?id=228611

Happend to me to Gotham 13.1 on Windows 7 and on Android 4.2.2

Regards, Tomas K.

schumi2004 commented 10 years ago

Confirmed, will fix later today.

Mafarricos commented 10 years ago

Just tested with some local files and didn't raised the popup to download subtitles. Is this still a bug or was fixed and the issue wasn't updated?

schumi2004 commented 10 years ago

Not sure, can't reproduce it.

schumi2004 commented 10 years ago

It's still there. Will check tomorrow.

Mafarricos commented 10 years ago

How you reproduced it?

schumi2004 commented 10 years ago

Reinstalled addon and played a series episode, happend every time. I know we're to look for and testing it as we speak to be sure it's solved.

Mafarricos commented 10 years ago

OK, if you are looking at it, I will leave it to you. Thanks.

schumi2004 commented 10 years ago

It's pretty simple, change line 49 til 91 if I'm correct. Change true with false and vice versa. That should fix it. It did in other addon I modded

schumi2004 commented 10 years ago

In default.py

Mafarricos commented 10 years ago

Will check it. This only happens to TV shows, correct? Em 22/06/2014 22:04, "schumi2004" notifications@github.com escreveu:

In default.py

— Reply to this email directly or view it on GitHub https://github.com/amet/service.autosubs/issues/22#issuecomment-46792912 .

Mafarricos commented 10 years ago

I don't thing changing the true/false is the right thing.

For eg: if (movieFullPath.find("pvr://") > -1) and getSettingAsBool('ExcludeLiveTV'): Debug("isExcluded(): Video is playing via Live TV, which is currently set as excluded location.") return False

Here you are telling that if path has pvr:// and is set to exclude LiveTV you will return TRUE (changing from FALSE to TRUE).

If you return TRUE it will execute the code to get subtitles, no? Isn't the problem related to the OR in this line: if (xbmc.Player().isPlayingVideo() and totalTime > ExcludeTime and ((not xbmc.getCondVisibility("VideoPlayer.HasSubtitles")) or (check_for_specific and not specific_language in availableLangs)) and all(movieFullPath.find (v) <= -1 for v in ignore_words) and (isExcluded(movieFullPath)) ):

You want all to be to execute the automatic push no?

I will test it.

Mafarricos commented 10 years ago

@Georgo in AutoSubs do you have specific language activated, if so to what language?

I tested with a movie and a serie localy and if I have subtitles To my doesn't pop ups nothing.

schumi2004 commented 10 years ago

With or without language configured?

schumi2004 commented 10 years ago

This is strange.

I tested it on a laptop with a clean XBMC install and reproduced it. I renamed files like this, and that worked while playing with autosubs settings, pref language etc. some.movie.name.2014.mkv some.movie.anem.2014.srt

Same test but now with subtitle file like this, and then it failes. some.movie.name.2014.en.srt

schumi2004 commented 10 years ago

I played with preferred language setting https://github.com/amet/service.autosubs/pull/14 and noticed that it doesn't seem to function as intended. I added a debug line to see what language it selected but it never returned any value.

Debug("[AutoSubsPlayer] Language selected: '%s'" % specific_language)

Mafarricos commented 10 years ago

Will try to test based in that, to see what's happening with specific_language

Mafarricos commented 10 years ago

Think it is corrected with this pull: https://github.com/amet/service.autosubs/pull/25

Mafarricos commented 10 years ago

Sometimes It seems I still get this problem, but only on a raspberry pi. With streams that load the subtitles at same time as video.

I will try to get the pattern, I don't know if a xbmc.sleep(2000) before vailableLangs = xbmc.Player().getAvailableSubtitleStreams() can prevent this problem, to delay and really load the subtitles before it gets if video has or not the subtitles?