Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: MythTV: Users

mythcal - script for synchronising MythTV recording schedule to a Google calendar

 

 

MythTV users RSS feed   Index | Next | Previous | View Threaded


richardfearn at gmail

Oct 11, 2009, 1:03 PM

Post #1 of 12 (1092 views)
Permalink
mythcal - script for synchronising MythTV recording schedule to a Google calendar

Hi all,

Quick shameless promotion: mythcal is a script that will synchronise
your MythTV recordings to a Google calendar. You can then view
upcoming recordings on the calendar, and turn off your MythTV server
to save power.

I've put the script on Google Code:

http://code.google.com/p/mythcal/

I hope some of you find it useful!

Regards,

Richard Fearn
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


patrick.archibald at gmail

Oct 11, 2009, 1:25 PM

Post #2 of 12 (1047 views)
Permalink
Re: mythcal - script for synchronising MythTV recording schedule to a Google calendar [In reply to]

Thanks Richard Fearn,

Works good. Is it designed to update the Google calendar with just today's
schedule? It might be nice to look at the next 14 days or so.

http://www.google.com/calendar/embed?src=3uo2eipa02rul2194evl2qg0ok%40group.calendar.google.com&ctz=America/New_York

Rock on, PLA

Patrick L Archibald
http://identi.ca/pla1
http://youtube.com/PatrickLArchibald
http://platechnotes.patrickarchibald.com
http://blog.patrickarchibald.com
http://patrickarchibald.com



On Sun, Oct 11, 2009 at 4:03 PM, Richard Fearn <richardfearn [at] gmail>
wrote:
Hi all,

Quick shameless promotion: mythcal is a script that will synchronise
your MythTV recordings to a Google calendar. You can then view
upcoming recordings on the calendar, and turn off your MythTV server
to save power.

I've put the script on Google Code:

http://code.google.com/p/mythcal/

I hope some of you find it useful!

Regards,

Richard Fearn
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


matt at mossholder

Oct 11, 2009, 1:35 PM

Post #3 of 12 (1047 views)
Permalink
Re: mythcal - script for synchronising MythTV recording schedule to a Google calendar [In reply to]

On Sun, 2009-10-11 at 21:03 +0100, Richard Fearn wrote:
> Hi all,
>
> Quick shameless promotion: mythcal is a script that will synchronise
> your MythTV recordings to a Google calendar. You can then view
> upcoming recordings on the calendar, and turn off your MythTV server
> to save power.
>
> I've put the script on Google Code:
>
> http://code.google.com/p/mythcal/
>
> I hope some of you find it useful!
>
> Regards,
>
> Richard Fearn

You can also do this with for Upcoming Recordings via MythWeb, if you
apply this patch:

http://svn.mythtv.org/trac/ticket/7270

Then just "Add by URL" with Google Calendar, and go.

Just make sure your ICS files are accessible to Google over the
intartubez.


--Matt



_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


richardfearn at gmail

Oct 11, 2009, 1:37 PM

Post #4 of 12 (1044 views)
Permalink
Re: mythcal - script for synchronising MythTV recording schedule to a Google calendar [In reply to]

Hi,

It should be putting all of your upcoming recordings into the
calendar. It should be OK for one-off recordings, but it might not
work 100% for recurring recordings, for example. I hope to look into
this soon.

I also want to look at avoiding the delete-and-repopulate that it does
every time your upcoming recordings change. It's not the most
efficient way to do the sync (although the deletes and adds are
batched, so they should all be done in a single request to Google).

Regards,

Rich
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


richardfearn at gmail

Oct 11, 2009, 1:59 PM

Post #5 of 12 (1050 views)
Permalink
Re: mythcal - script for synchronising MythTV recording schedule to a Google calendar [In reply to]

Hi,

> You can also do this with for Upcoming Recordings via MythWeb

How does it work? I can't find any instructions for doing it. Is it
built in to the standard MythWeb?

> if you apply this patch:
>
> http://svn.mythtv.org/trac/ticket/7270

The patch doesn't seem to work for me... maybe just a temporary
problem with Trac...

> Just make sure your ICS files are accessible to Google over the
> intartubez.

That is an advantage of the mythcal script - the programmes are pushed
out to the Google calendar, rather than pulled by Google, so the
MythTV server doesn't need to be accessible over the internet.

Thanks,

Rich
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


memoryguy at gmail

Nov 26, 2009, 1:57 PM

Post #6 of 12 (883 views)
Permalink
Re: mythcal - script for synchronising MythTV recording schedule to a Google calendar [In reply to]

On Sat, Oct 24, 2009 at 14:53, Richard Fearn <richardfearn [at] gmail> wrote:
>
> I've used pytz (http://pypi.python.org/pypi/pytz) to convert the local
> times in the Program objects to UTC.
>
> The new version is on Google Code:
>
> http://code.google.com/p/mythcal/

Hi Richard,

I'm using the "read-only" version from SVN, revision 10. It works, but
it doesn't remove the old calendar entries, so every time I run it, I
keep getting more and more entries in the calendar.

Have I likely misconfigured something? :)

When I run with -n it does list all the existing programs and says it
wants to delete them, but then they don't get deleted. I was thinking
maybe I don't have the timezone configured correctly. Could that be
it?

Thanks,
aaron
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


kenneth.emerson at gmail

Nov 27, 2009, 11:52 PM

Post #7 of 12 (851 views)
Permalink
Re: mythcal - script for synchronising MythTV recording schedule to a Google calendar [In reply to]

On Sat, Oct 24, 2009 at 1:53 PM, Richard Fearn <richardfearn [at] gmail>wrote:

> Hello,
>
> > Here's a quick twenty minute rewrite using the python bindings.
>
> Thanks for that! I've changed mythcal to use the Python bindings
> rather than go directly to the database. (Thanks also to Michael for
> suggesting the bindings.) I've opted to stick with the dictionaries
> for holding program information.
>
> I've used pytz (http://pypi.python.org/pypi/pytz) to convert the local
> times in the Program objects to UTC.
>
> The new version is on Google Code:
>
> http://code.google.com/p/mythcal/
>
> Regards,
>
> Rich
>
>
Rich:

I downloaded your script and followed your instructions, but I got an error
from the MythTV python bindings:

Traceback (most recent call last):
File "./mythcal", line 107, in <module>
recordings = get_recordings_from_backend()
File "./mythcal", line 99, in get_recordings_from_backend
if mythtv.isRecording(recorder):
File "/usr/local/lib/python2.6/dist-packages/MythTV/MythTV.py", line 295,
in isRecording
res = self.backendCommand('QUERY_RECORDER
'+BACKEND_SEP.join([recorder,'IS_RECORDING']))
TypeError: sequence item 0: expected string, int found

So, just for grins, I changed line 295 to be:

res = self.backendCommand('QUERY_RECORDER
'+BACKEND_SEP.join([str(recorder),'IS_RECORDING']))

changing 'recorder' from an int to a string and, lo and behold, I had
entries in my calendar. However, I don't know what I am breaking by changing
this. Any ideas?

Regards,

Ken E.


kenneth.emerson at gmail

Nov 28, 2009, 12:43 AM

Post #8 of 12 (840 views)
Permalink
Re: mythcal - script for synchronising MythTV recording schedule to a Google calendar [In reply to]

Rich:

> Actually, what I meant to say was that by changing your script at line 99
> to:
>

if mythtv.isRecording(str(recorder)):

I could get it to "work". Am I missing something? Perhaps a different
version of python (using Ubuntu 9.04 and python v2.6.2).

Regards,
>
> Ken E.
>


dlknight at sdf

Nov 28, 2009, 4:47 AM

Post #9 of 12 (839 views)
Permalink
Re: mythcal - script for synchronising MythTV recording schedule to a Google calendar [In reply to]

On Sat, November 28, 2009 8:43 am, Kenneth Emerson wrote:
> Rich:
>
>> Actually, what I meant to say was that by changing your script at line
>> 99
>> to:
>>
>
> if mythtv.isRecording(str(recorder)):
>
> I could get it to "work". Am I missing something? Perhaps a different
> version of python (using Ubuntu 9.04 and python v2.6.2).
>
> Regards,
>>
>> Ken E.
>>
>

Excellent I was going to take a look at this today and someone has beaten
me to it :)

Looks like you need to change the following lines in mythcal:

Line #98
From: if mythtv.isRecording(recorder):
To: if mythtv.isRecording(str(recorder)):

Line #99
From: current.append(mythtv.getCurrentRecording(recorder))
To: current.append(mythtv.getCurrentRecording(str(recorder)))

Dave K.


_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


kenneth.emerson at gmail

Nov 28, 2009, 9:26 AM

Post #10 of 12 (820 views)
Permalink
Re: mythcal - script for synchronising MythTV recording schedule to a Google calendar [In reply to]

On Sat, Nov 28, 2009 at 6:47 AM, David Knight <dlknight [at] sdf>wrote:

> On Sat, November 28, 2009 8:43 am, Kenneth Emerson wrote:
> > Rich:
> >
> >> Actually, what I meant to say was that by changing your script at line
> >> 99
> >> to:
> >>
> >
> > if mythtv.isRecording(str(recorder)):
> >
> > I could get it to "work". Am I missing something? Perhaps a different
> > version of python (using Ubuntu 9.04 and python v2.6.2).
> >
> > Regards,
> >>
> >> Ken E.
> >>
> >
>
> Excellent I was going to take a look at this today and someone has beaten
> me to it :)
>
> Looks like you need to change the following lines in mythcal:
>
> Line #98
> From: if mythtv.isRecording(recorder):
> To: if mythtv.isRecording(str(recorder)):
>
> Line #99
> From: current.append(mythtv.getCurrentRecording(recorder))
> To: current.append(mythtv.getCurrentRecording(str(recorder)))
>
> Dave K.
>
>
> I now have seen that someone has entered a ticket against trunk for this
problem:

http://svn.mythtv.org/trac/ticket/7648#comment:2

Which doesn't appear to have been commited yet. So not sure where this will
be fixed.

But on another note, I have discovered that the current rev of mythcal is
not deleting all of the events of the calendar when it runs. Seems to be
bypassing the events that are close to the date of the run (+7 days?). This
results is duplicate events for each time the script is run (assuming it
finds some difference with its cache file).

-- Ken E.

> _______________________________________________
> mythtv-users mailing list
> mythtv-users [at] mythtv
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
>


richardfearn at gmail

Nov 28, 2009, 10:16 AM

Post #11 of 12 (817 views)
Permalink
Re: mythcal - script for synchronising MythTV recording schedule to a Google calendar [In reply to]

Hi,

Sorry - I haven't been receiving mythtv-users mail for a while so
didn't see the questions being asked here.

aaron (memoryguy) - I'm not sure why all the old calendar entries
aren't being deleted. I'll look into it; could you file a bug (at
http://code.google.com/p/mythcal/issues/list) ?

As for the mythtv.isRecording(recorder) problem, there was another
thread on this issue:

http://www.gossamer-threads.com/lists/mythtv/users/409394?do=post_view_flat

A bug was filed against the MythTV Python bindings:

http://svn.mythtv.org/trac/ticket/7648

In the meantime these changes to mythcal should work around the problem:

http://www.gossamer-threads.com/lists/mythtv/users/410716?do=post_view_threaded

Regards,

Rich
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


kenneth.emerson at gmail

Nov 28, 2009, 4:11 PM

Post #12 of 12 (794 views)
Permalink
Re: mythcal - script for synchronising MythTV recording schedule to a Google calendar [In reply to]

For those of you who have discovered what I have about this script (not
deleting all of the events before re-adding them), I believe I found the
problem in the google calendar API. When retrieving bulk events, there is a
server parameter (max_results) that appears to default to 25. If you have
more than 25 scheduled recordings, you will end up with duplicates in your
calendar since they do not all get deleted. I have updated my bug report
with this information at http://code.google.com/p/mythcal/issues/list.

-- Ken E.

MythTV users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.