Quick fix for zero block lenght NZB files. Build fix for Ubuntu 13.04

ranzbak [2013-05-14 12:40]
Quick fix for zero block lenght NZB files. Build fix for Ubuntu 13.04

git-svn-id: https://old.setv.nl/svn/swarmtv@319 88541080-9ad6-de11-9093-5254007c1f44
Filename
trunk/swarmtv/libswarmtv/CMakeLists.txt
trunk/swarmtv/libswarmtv/curlfile.c
trunk/swarmtv/libswarmtv/filehandler/nzb/nzbparse.c
trunk/swarmtv/libswarmtv/setup.c
trunk/swarmtv/shellfront/CMakeLists.txt
trunk/swarmtv/shellfront/man/swarmtv.1
trunk/swarmtv/shellfront/present.c
trunk/swarmtv/shellfront/swarmtv.c
diff --git a/trunk/swarmtv/libswarmtv/CMakeLists.txt b/trunk/swarmtv/libswarmtv/CMakeLists.txt
index 62f597d..3e86940 100644
--- a/trunk/swarmtv/libswarmtv/CMakeLists.txt
+++ b/trunk/swarmtv/libswarmtv/CMakeLists.txt
@@ -33,7 +33,7 @@ ENDIF(ESMTP_FOUND)

 # Compiler directives
 if (UNIX AND NOT WIN32)
-	add_definitions(-Wall -W -fPIC)
+	add_definitions(-Wall -W -fPIC -lm)
 else (WIN32)
 	add_definitions(-Wall -W -DPIC -DDLL_EXPORT)
 endif (UNIX AND NOT WIN32)
diff --git a/trunk/swarmtv/libswarmtv/curlfile.c b/trunk/swarmtv/libswarmtv/curlfile.c
index ade8d20..49fa414 100644
--- a/trunk/swarmtv/libswarmtv/curlfile.c
+++ b/trunk/swarmtv/libswarmtv/curlfile.c
@@ -20,7 +20,7 @@
 #include <sqlite3.h>

 #include <curl/curl.h>
-#include <curl/types.h>
+//#include <curl/types.h>
 #include <curl/easy.h>

 #include "types.h"
diff --git a/trunk/swarmtv/libswarmtv/filehandler/nzb/nzbparse.c b/trunk/swarmtv/libswarmtv/filehandler/nzb/nzbparse.c
index bda3ef8..35f9a42 100644
--- a/trunk/swarmtv/libswarmtv/filehandler/nzb/nzbparse.c
+++ b/trunk/swarmtv/libswarmtv/filehandler/nzb/nzbparse.c
@@ -268,7 +268,11 @@ int rsstgetnzbinfo(rsstor_handle *handle, char *url, metafileprops **props)
      * Use them to calculate the pieces length.
      */
     rc = getnzbsize(doc, &((*props)->size), &((*props)->file_nr));
-    (*props)->pieces_length = (*props)->size/(*props)->file_nr;
+    if((*props)->size != 0.0) {
+      (*props)->pieces_length = (*props)->size/(*props)->file_nr;
+    } else {
+      (*props)->pieces_length = -1;
+    }
   }

   /*
diff --git a/trunk/swarmtv/libswarmtv/setup.c b/trunk/swarmtv/libswarmtv/setup.c
index 4c35300..7153a19 100644
--- a/trunk/swarmtv/libswarmtv/setup.c
+++ b/trunk/swarmtv/libswarmtv/setup.c
@@ -23,7 +23,7 @@
 #include <time.h>
 #include <sqlite3.h>
 #include <curl/curl.h>
-#include <curl/types.h>
+//#include <curl/types.h>
 #include <curl/easy.h>
 #include <libxml/parser.h>

diff --git a/trunk/swarmtv/shellfront/CMakeLists.txt b/trunk/swarmtv/shellfront/CMakeLists.txt
index caef4ad..f68f709 100644
--- a/trunk/swarmtv/shellfront/CMakeLists.txt
+++ b/trunk/swarmtv/shellfront/CMakeLists.txt
@@ -33,7 +33,7 @@ IF(DBUSGLIB_FOUND)
   INCLUDE_DIRECTORIES( ${GLIB2_INCLUDE_DIR} )
   INCLUDE_DIRECTORIES( ${GLIBCONFIG_INCLUDE_DIR} )
   SET(optionalLibs ${optionalLibs} ${GLIB2_LIBRARIES} )
-  SET(optionalLibs ${optionalLibs} ${DBUSGLIB_LIBRARY} )
+  SET(optionalLibs ${optionalLibs} ${DBUSGLIB_LIBRARY} -lm -ldbus-1 )
   ADD_DEFINITIONS(-DRSST_DBUS_GLIB_ENABLE="\\"1\\"")
 ENDIF(DBUSGLIB_FOUND)

diff --git a/trunk/swarmtv/shellfront/man/swarmtv.1 b/trunk/swarmtv/shellfront/man/swarmtv.1
index ca3e1ea..b64526a 100644
--- a/trunk/swarmtv/shellfront/man/swarmtv.1
+++ b/trunk/swarmtv/shellfront/man/swarmtv.1
@@ -1,4 +1,4 @@
-.TH swarmtv 1  "February 3, 2010" "version 0.9" "USER COMMANDS"
+.TH swarmtv 1  "February 3, 2010" "version 0.9.2" "USER COMMANDS"
 .SH NAME
 swarmtv \- Forwards shows from RSS to your torrent program.
 .SH SYNOPSIS
diff --git a/trunk/swarmtv/shellfront/present.c b/trunk/swarmtv/shellfront/present.c
index c6270ec..8c573f1 100644
--- a/trunk/swarmtv/shellfront/present.c
+++ b/trunk/swarmtv/shellfront/present.c
@@ -31,7 +31,7 @@
 /*
  * Program version
  */
-#define PROGVERSION "0.8"
+#define PROGVERSION "0.9.2"

 /*
  * Buffer size used in present routines.
diff --git a/trunk/swarmtv/shellfront/swarmtv.c b/trunk/swarmtv/shellfront/swarmtv.c
index d0d6c5f..55de777 100644
--- a/trunk/swarmtv/shellfront/swarmtv.c
+++ b/trunk/swarmtv/shellfront/swarmtv.c
@@ -21,7 +21,7 @@
 #include <stdio.h>
 #include <sqlite3.h>
 #include <curl/curl.h>
-#include <curl/types.h>
+//#include <curl/types.h>
 #include <curl/easy.h>
 #include <libxml/parser.h>
 #include <signal.h>