$ git clone http://tcclient.ion.nu/tc_client.git
commit 220c3705048bc8a06a25b81e585cd7839a279ade
Author: Alicia <...>
Date:   Tue Aug 11 22:33:33 2015 +0200

    modbot: take time offset into account for the duration of videos.

diff --git a/ChangeLog b/ChangeLog
index bcf65cd..7e04d69 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,5 @@
+0.36:
+modbot: take time offset into account for the duration of videos.
 0.35:
 Adjusted for tinychat authentication changes (both for joining the channel and to use moderator accounts)
 Send account username in AMF0 "connect" command at startup regardless of whether we are modded or not, as is now required for non-mod accounts (contributed by Jade)
diff --git a/Makefile b/Makefile
index 323ea8c..943e621 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-VERSION=0.35
+VERSION=0.36pre
 CFLAGS=-g3 -Wall $(shell curl-config --cflags)
 LIBS=-g3 $(shell curl-config --libs)
 PREFIX=/usr/local
diff --git a/utilities/modbot/modbot.c b/utilities/modbot/modbot.c
index 6097bec..f57406a 100644
--- a/utilities/modbot/modbot.c
+++ b/utilities/modbot/modbot.c
@@ -143,11 +143,12 @@ void playnextvid()
   playing=queue.items[0].video;
   requester=queue.items[0].requester;
   title=queue.items[0].title;
-  say(0, "/mbs youTube %s %u %s\n", playing, queue.items[0].timeoffset, queue.items[0].title);
+  say(0, "/mbs youTube %s %u %s\n", playing, queue.items[0].timeoffset*1000, queue.items[0].title);
+  unsigned int duration=getduration(playing)-queue.items[0].timeoffset;
   --queue.itemcount;
   memmove(queue.items, &queue.items[1], sizeof(struct queueitem)*queue.itemcount);
   // Find out the video's length and schedule an alarm for then
-  alarm(getduration(playing));
+  alarm(duration);
   started=time(0);
 }
 
diff --git a/utilities/modbot/queue.c b/utilities/modbot/queue.c
index 58ec585..ffffba0 100644
--- a/utilities/modbot/queue.c
+++ b/utilities/modbot/queue.c
@@ -54,7 +54,7 @@ void queue_add(struct queue* queue, const char* item, const char* requester, con
     queue->items[queue->itemcount-1].video=strndup(item, len);
     queue->items[queue->itemcount-1].requester=strdup(requester);
     queue->items[queue->itemcount-1].title=strdup(title);
-    queue->items[queue->itemcount-1].timeoffset=timeoffset*1000;
+    queue->items[queue->itemcount-1].timeoffset=timeoffset;
     item=&item[len];
   }
 }