pymedusa / Medusa

Automatic Video Library Manager for TV Shows. It watches for new episodes of your favorite shows, and when they are posted it does its magic.
https://pymedusa.com
GNU General Public License v3.0
1.76k stars 273 forks source link

Backlog Overview Shows Episodes Airing Days in the Future #4249

Open gmusgrave opened 6 years ago

gmusgrave commented 6 years ago

Branch/Commit: Branch: master Commit: 212cd1c8a350f2d5ca40f172ed5a227d9a5cb80f Version: 0.2.4

OS: Windows-7-6.1.7601-SP1

What you did: Nothing. Medusa was just operating automatically.

What happened: It is now 11am on Fri May 25

My Backlog Overview shows three shows in the future: The Fourth Estate Airdate: Sun, 27-05-2018, 12:00 AM Patrick Melrose Airdate: Sat, 26-05-2018, 12:00 AM Vida: Sat, 26-05-2018, 12:00 AM

I don't know if this is significant or not, but one thing they all have in common is airing at 12:00 AM. Could this be a bug?

What you expected: That these shows would not appear in the Backlog Overview until after their airdates.

Logs:

2018-05-25 07:36:46 DEBUG    DAILYSEARCHER :: [212cd1c] Started updating network timezones
2018-05-25 07:36:47 DEBUG    DAILYSEARCHER :: [212cd1c] GET URL: https://cdn.pymedusa.com/sb_network_timezones/network_timezones.txt [Status: 200]
2018-05-25 07:36:47 DEBUG    DAILYSEARCHER :: [212cd1c] User-Agent: Medusa/0.2.3 (Windows; 7; de851640-600f-11e8-80eb-4061868c11e8)
2018-05-25 07:36:47 DEBUG    DAILYSEARCHER :: [212cd1c] Finished updating network timezones
2018-05-25 07:36:47 DEBUG    DAILYSEARCHER :: [212cd1c] 347162: Formatting pattern: %SN - S%0SE01 - %EN -> The Fourth Estate - S01E01 - First 100 Days
2018-05-25 07:36:47 INFO     DAILYSEARCHER :: [212cd1c] Setting status (Wanted) for show airing today: The Fourth Estate - S01E01 - First 100 Days 
2018-05-25 07:36:47 DEBUG    DAILYSEARCHER :: [212cd1c] Looking up XEM scene mapping for show ID 338946 on tvdb
2018-05-25 07:36:48 DEBUG    DAILYSEARCHER :: [212cd1c] GET URL: http://thexem.de/map/havemap?origin=tvdb [Status: 200]
2018-05-25 07:36:48 DEBUG    DAILYSEARCHER :: [212cd1c] User-Agent: Medusa/0.2.3 (Windows; 7; de851640-600f-11e8-80eb-4061868c11e8)
2018-05-25 07:36:48 DEBUG    DAILYSEARCHER :: [212cd1c] No XEM data for show ID 338946 on tvdb
2018-05-25 07:36:48 DEBUG    DAILYSEARCHER :: [212cd1c] 338946: Formatting pattern: %SN - S%0SE03 - %EN -> Patrick Melrose - S01E03 - Some Hope
2018-05-25 07:36:48 INFO     DAILYSEARCHER :: [212cd1c] Setting status (Wanted) for show airing today: Patrick Melrose - S01E03 - Some Hope 
2018-05-25 07:36:48 DEBUG    DAILYSEARCHER :: [212cd1c] Looking up XEM scene mapping for show ID 340976 on tvdb
2018-05-25 07:36:48 DEBUG    POSTPROCESSOR :: [212cd1c] Starting new thread: POSTPROCESSOR
2018-05-25 07:36:48 DEBUG    POSTPROCESSOR :: [212cd1c] Processing path: D:\Downloads\SickRage
2018-05-25 07:36:48 DEBUG    POSTPROCESSOR :: [212cd1c] No processable items found in folder: D:\Downloads\SickRage
2018-05-25 07:36:48 INFO     POSTPROCESSOR :: [212cd1c] Successfully processed.
2018-05-25 07:36:48 DEBUG    DAILYSEARCHER :: [212cd1c] GET URL: http://thexem.de/map/havemap?origin=tvdb [Status: 200]
2018-05-25 07:36:48 DEBUG    DAILYSEARCHER :: [212cd1c] User-Agent: Medusa/0.2.3 (Windows; 7; de851640-600f-11e8-80eb-4061868c11e8)
2018-05-25 07:36:48 DEBUG    DAILYSEARCHER :: [212cd1c] No XEM data for show ID 340976 on tvdb
2018-05-25 07:36:49 DEBUG    DAILYSEARCHER :: [212cd1c] 340976: Formatting pattern: %SN - S%0SE04 - %EN -> Vida - S01E04 - Episode 4
2018-05-25 07:36:49 INFO     DAILYSEARCHER :: [212cd1c] Setting status (Wanted) for show airing today: Vida - S01E04 - Episode 4 
2018-05-25 07:36:49 DEBUG    DAILYSEARCHER :: [212cd1c] Transaction with 3 queries executed
2018-05-25 07:36:50 INFO     SEARCHQUEUE-DAILY-SEARCH :: [212cd1c] Beginning daily search for new episodes
gmusgrave commented 6 years ago

Happened again today (Thur May 31).

My Backlog Overview shows "Patrick Melrose S01E04" although it shows its airdate as "Sat, 02-06-2018, 12:00 AM" – over two days before it should appear!

gmusgrave commented 6 years ago

This behaviour is definitely triggered by an air time of 12:00am.

Today (Fri Jun 1), two shows were added to my Backlog Overview:

Vida S01E05 –  airdate: Sun, 03-06-2018, 12:00 AM

A Very English Scandal S01E03 –   airdate: Sun, 03-06-2018, 12:00 AM

I had just added this last show this morning.

I suspect it has something to do with the ambiguity surrounding the time of 12:00am (Midnight). This is a vague time, and there is differing consensus as to whether this means "first thing in the morning," or "last thing at night." In 24H format there are actually TWO times that BOTH represent Midnight: 24:00 and 0:00.

In either interpretation, it doesn't explain why it's out by two days or so in Medusa.

gmusgrave commented 6 years ago

OK... I think I can safely confirm that this issue only happens when the airtime of a show is 12:00am.

I recently added two new shows, and they both appeared in the Backlog Overview about two days in advance of airing. They both had airtimes of 12:00am.

OmgImAlexis commented 6 years ago

Just adding about the 24 hour time, there's no such thing as 24:00. Time goes from 23:59:59 to 00:00:01.

gmusgrave commented 6 years ago

Sorry, but I must respectfully disagree. The seconds around midnight tick by as follows: 23:59:59, 24:00:00, 00:00:01. Or, because 24:00:00 can also be written as 00:00:00, 23:59:59, 00:00:00, 00:00:01.

Refer to this link for a chart: http://militarytimechart.com/

OmgImAlexis commented 6 years ago

I'm talking about python/js not military time.

gmusgrave commented 6 years ago

So midnight doesn't exist in Python or JavaScript? That seems like a serious oversight. I would have expected it to be 00:00:00.

If this is true, then this could be the problem. A show with an airtime of midnight would have a non-existent time as far as the scripting language is concerned!

labrys commented 6 years ago

@gmusgrave In python versions before 3.5, a time of midnight UTC (aka 0:00:00) evaluates to False. That was intended by design and is documented in the python docs. They did change their mind and as of python 3.5 it evaluates to True. See https://bugs.python.org/issue13936

labrys commented 6 years ago

@OmgImAlexis python still keeps time in 24-hour just like military time. It uses 00:00:00 to represent Midnight (24:00:00 is not valid in python) but a python time of 00:00:00 if it is not timezone aware or if it is in UTC. This was intended so that a time of 0 evaluates to False like most python objects generally do. Time still ticks from 23:59:59 to 00:00:00 though. Modern versions of python no longer have this issue.

gmusgrave commented 5 years ago

Has this been fixed?

It is still an issue that affects many shows. For me, it affects about 4 out of 10 new shows I add – especially those from streaming services such as Amazon, Netflix, or Hulu, where they often have airtimes of midnight.

These shows show up in the backlog overview days before their air date.

Is it not possible to fix?

labrys commented 5 years ago

@gmusgrave It has not been fixed with Python 2.7. Medusa has begun Python 3 compatibility. I am not certain how far they have gotten, but if it is currently usable then you can run Medusa with Python 3.5 or greater and this bug would no longer be an issue.

p0psicles commented 5 years ago

It is with the develop branch

gmusgrave commented 4 years ago

@labrys Sorry, but I'm now running Python 3 (3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)]), and this is still happening.

A new show I recently added is doing the same thing. The Birch S01E01 airs on "Fri, 11-10-2019, 12:00 AM," and started appearing in my Backlog Overview list on Tuesday (Oct 8).

narimanshariat commented 2 years ago

Seems to be an issue still. Doesn't anyone have a workaround for this?

p0psicles commented 2 years ago

You'd have to provide a lot more details. I'd say open a new issue.

I'm closing this one.

gmusgrave commented 2 years ago

I'm the OP, and I believe that I provided rather a lot of detail about this issue (please read this thread from the beginning). If you need more, please elaborate.

It has never been addressed or fixed, and is still an issue. I don't think it should be closed.

Thanks.

p0psicles commented 2 years ago

Ow sorry. Took you for a new user. I can reopen. But thing is. Medusa changed a lot. Once there was spoken about upgrade to python3.

Also if it's still an issue. Id still need some updated info. Which show, which indexer, debug logs for the episode updater threat.

Also check that you don't have a date offset configured.

narimanshariat commented 2 years ago

I can tell you the observed behavior affects any show that has a local airdate of midnight (12:00:00 AM). My instance is set for Pacific (Los Angeles) timezone. Recently Pacemaker, Star Trek Discovery and Raise By Wolves all aired at midnight pacific and all were not automatically searched for.

Also another peculiar behavior that seems related. When viewing the show list in banner layout and sorted by "Prev Ep" the above named shows are not correctly sorted. As of right now they should appear at the top of the sorted list for me but the sort is not accounting for the episode that aired today at midnight. It looks like it is counting last week's episode as the previous episode instead of today's.

I am running Medusa 0.5.23 on the official docker image.