Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local timezone support #62

Open
VeNoMouS opened this issue May 18, 2013 · 14 comments
Open

Local timezone support #62

VeNoMouS opened this issue May 18, 2013 · 14 comments
Labels

Comments

@VeNoMouS
Copy link

Hi there, you've done some awesome work, just wondering if you could add local timezone support for the coming soon etc..?

@VeNoMouS
Copy link
Author

VeNoMouS commented Jun 1, 2013

Started work on this myself... and making some decent headway...

19:30:44 INFO::SHOWQUEUE-ADD :: 205901: Loading show info from theTVDB
19:30:44 INFO::SHOWQUEUE-ADD :: [TimeZone] Searching for network: The Hub
19:30:45 INFO::SHOWQUEUE-ADD :: [TimeZone] Network found with TimeZone: US/Eastern
19:30:45 INFO::SHOWQUEUE-ADD :: [TimeZone] Local Time: 2013-06-01 19:30:45.002322+12:00
19:30:45 INFO::SHOWQUEUE-ADD :: [TimeZone] Network TimeZone: 2013-06-01 03:30:45.002322-04:00
19:30:45 INFO::SHOWQUEUE-ADD :: [TimeZone] Airs Time: 7:00 PM
19:30:45 INFO::SHOWQUEUE-ADD :: [TimeZone] Airs DayOfWeek: Friday
19:30:45 INFO::SHOWQUEUE-ADD :: [TimeZone] Matched Delta: 2013-06-07 19:00:00 EDT
19:30:45 INFO::SHOWQUEUE-ADD :: [TimeZone] Local_TimeZone Delta: 2013-06-08 11:00:00 NZST

@junalmeida
Copy link
Owner

What problems do you have regarding this? My system runs at GTM -3, and I didn't noticed delays.

@VeNoMouS
Copy link
Author

I'm personally +12, I'm in New Zealand, so shows that air come up as "missed" because I'm ahead a day of everyone else in the world :P

So what I'm doing is using a pivot table with each "Network" company with their local timezone when the show is added, and then converting it to UTC so when DST kicks in there's no drift, and when it polls tvrage/tvdb it looks at the UTC time and converts the episode air date to local timezone... still a work in progress as I'm trying to think of a "clean" way to store the UTC vs non converted time in the db.

@arogl
Copy link

arogl commented Jun 17, 2013

Why not just refer to this pull midgetspy#635?

have added it to midgetspy master and working well for myself.

@VeNoMouS
Copy link
Author

It's pretty flawed in the fact that it has to do the local up continuously rather then just once.. if you read the comment sections they pointed out a number of problems in the design and they actually requested they do it once when the show is added... which is what I'm doing.. I'm actually using his network pivot table for the timezones

also it wasn't added to the midgetspy's master as far as im aware Prinz23 closed the pull request

@junalmeida
Copy link
Owner

Very nice!!
Ah, SB current downloads a remote file for scene exceptions (scene_exceptions.py) that it checks for updates. I guess that is a nice approach to update the timezone of new networks. Where do you get this info?

@wjbeckett
Copy link

Can we not get this merged to enable local timezone for coming eps and searching?
https://github.com/Prinz23/Sick-Beard/tree/timezones-coming-eps

@VeNoMouS
Copy link
Author

Well, the problem that is with that branch, is that it constantly works has to do the date value converts, its not stored in the database with the local timezone, it adds alot of cpu work for no reason... if you read the notes this was also stated... I havent done any further development on my branch of this... Spose I should pick it back up...

I took a differnet approch from Prinz23 , my code converts the first air date and air time of each episode as the tv info updates off tvdb and tvrage etc.. this way there is ever only one call for date converts , and it doesnt require you to then to go hack the crap out of the SB base for sql queries and what not...

Just my 2 cents for doing it a more functional and less complex way... @junalmeida may wise to merge what you have posted, but it hasnt had any development in over a year on it, and it was never merged into the main branch...

@wjbeckett
Copy link

@VeNoMouS Ah okay. Thanks for the reply.
I'd definitely love to see this implemented as The coming episodes is wrong and SB searches for eps that haven't actually aired (I'm in Australia so ahead of UTC).

Would be awesome to have some sort of local timezone functionality in SB finally!

@VeNoMouS
Copy link
Author

I'm in new zealand, and UTC is the preferred way of storing datetime as there is no daylight savings, so you can store that time in UTC then convert easier to any timezone with out any drift due to day light savings

@wjbeckett
Copy link

Oh yeah, I understand that. I'm just saying it'd be really nice to see a localized time zone setting to improve searching and improve the coming episodes page.

@Prinz23
Copy link

Prinz23 commented Jul 6, 2014

The Search is not affected by the date/time. The date, time is only for humans to read as a info. And cpu load is not really relevant and it's only a additional load when a human request a page with a date/time, since Sickbeard itself doesn't care about date/times.

@VeNoMouS
Copy link
Author

VeNoMouS commented Jul 7, 2014

@Prinz23 its more for "comming episodes" etc.. its purely the users visual experience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants