Bug #885

Wrong subtitle

Added by Jérôme S. over 8 years ago. Updated about 8 years ago.

Status:FixedStart date:02/26/2012
Priority:NormalDue date:
Assignee:Andreas Smas% Done:

100%

Category:Filesystem
Target version:3.6
Found in version:3.3.223 Platform:PS3

Description

Sometimes, rarely, another subtitle comes with the video I play than the right subtitle named after the video, and in the same folder.

How can I check if it's from showtime or miniDLNA ?

I have a lot of video file, organized in separate folder, and to fix this I move the folder with the subtitle selected away, and reload miniDLNA so showtime can play my video with its subtitle.
All subtitles are srt file, video are avi/xvid files.

Associated revisions

Revision 70a41b2c
Added by Andreas Smas over 8 years ago

Don't write stuff to cache that we never will be able to retrieve again.

Fixes #885 (hopefully)

Change included in version 3.5.96

Revision 979eef30
Added by Andreas Smas about 8 years ago

Allow blob cache to be explicitly disabled for some requests

Fixes #885

Change included in version 3.5.159

History

#1 Updated by Jérôme S. over 8 years ago

After some investigation, it does not come from miniDLNA or uShare but Showtime cache system.

Tested with last version, it happens after some days of use. Removing cache folder in PS3 fix the bug, but it re-appears after days of use.

#2 Updated by Andreas Smas over 8 years ago

  • Category set to Filesystem
  • Status changed from New to Accepted
  • Target version set to 3.6

I wonder if miniDLNA somehow changes its URLs after restart or something.

I don't think that Showtime should be able to mixup stuff in its cache.
I have miniDLNA so I will try to investigate

#3 Updated by Jérôme S. over 8 years ago

If URLs may change after a restart and re-building DB, which I do all couple days, why the video played is the good one, but not the sub ?
Does Showtime's cache only keep sub or metadata ?

Can you provide a from GUI action "clear cache" ?

Is it possible Showtime's cache system can see when it is outdated and clear itself ?

#4 Updated by Andreas Smas over 8 years ago

Jérôme S. wrote:

If URLs may change after a restart and re-building DB, which I do all couple days, why the video played is the good one, but not the sub ?

The video is not cached but the subtitle is. So showtime believes it loads the correct sub but in
fact the URL has changed its contents behind showtime's back.

Does Showtime's cache only keep sub or metadata ?

Can you provide a from GUI action "clear cache" ?

Yes, that's probably a good idea anyway

Is it possible Showtime's cache system can see when it is outdated and clear itself ?

It should be able to do that if the HTTP headers are correct. but perhaps minidlna does something wrong

#5 Updated by Jérôme S. over 8 years ago

So Showtime checks with Last-Modified header and/or ETag ?

I assume cache is considering outdated if Last-Modified datetime is > to cache datetime or if there is no Last-Modified header.
With ETag, cache should store resource and ETag. On next request, if there is no ETag, or if ETag != from cached resource's ETag, cache must be renew.
It should work.

The thing is, if I add a subtitle file along a video, I will play that video on showtime. Showtime will see the url/id, find a match in the cache, and go with the cached sub, which is a cached sub from another video, that had the same url/id before reloaded miniDLNA data.
But miniDLNA http response should show that this video is new (because I did reload all data) with a more recent Last-Modified datetime than cache or a different ETag. (or maybe nothing, but in case of nothing... dont use cache).

If miniDLNA use Last-Modified the wrong way, like datetime of file creation, it is useless and ETag should be privileged.

#6 Updated by Jérôme S. over 8 years ago

Also, I would say, caching property or metadata, avoiding computing those, is relevant, but caching separate data / files that "normally" goes with the file is dangerous. You can't be sure, in anyway, that because the video did not change, that the files around did not.

#7 Updated by Andreas Smas over 8 years ago

Jérôme S. wrote:

So Showtime checks with Last-Modified header and/or ETag ?

Actually it does not look at the ETag at all right now.
It does however always store stuff in the cache together with "max-age" and "last-modified" HTTP headers. This will be acted on during reading of the cache next time.
I'm gonna change this so it does not needlessly store stuff in the cache which will never be used.

I've looked at the miniDLNA responses and there are no caching headers in them so Showtime should not use caching there.

That said there has certainly been a bunch of fixes related to caching and HTTP since 3.3.223.

I assume cache is considering outdated if Last-Modified datetime is > to cache datetime or if there is no Last-Modified header.
With ETag, cache should store resource and ETag. On next request, if there is no ETag, or if ETag != from cached resource's ETag, cache must be renew.
It should work.

The thing is, if I add a subtitle file along a video, I will play that video on showtime. Showtime will see the url/id, find a match in the cache, and go with the cached sub, which is a cached sub from another video, that had the same url/id before reloaded miniDLNA data.
But miniDLNA http response should show that this video is new (because I did reload all data) with a more recent Last-Modified datetime than cache or a different ETag. (or maybe nothing, but in case of nothing... dont use cache).

If miniDLNA use Last-Modified the wrong way, like datetime of file creation, it is useless and ETag should be privileged.

#8 Updated by Andreas Smas over 8 years ago

  • Status changed from Accepted to Fixed
  • % Done changed from 0 to 100

#9 Updated by Jérôme S. over 8 years ago

Yep I opened the bug with 3.3.223 but it was still there in the 3.4.

When released I will try this changeset, but it takes time to test this sneaky bug.

#10 Updated by Jérôme S. over 8 years ago

Bug still presents in last build.

#11 Updated by Jérôme S. about 8 years ago

Do you need some extra information ? How can I help you ?

#12 Updated by Andreas Smas about 8 years ago

  • Status changed from Fixed to Accepted

I have stuff that is used to disable caching in a different branch but that will probably take some time before that merges to master.
I'll have to add something different in the meantime.

#13 Updated by Andreas Smas about 8 years ago

  • Status changed from Accepted to Fixed

#14 Updated by Jérôme S. about 8 years ago

Awesome, I can't wait to test this.

Also available in: Atom PDF