]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
HTSP v35: Add support for recording file size
authorFlole998 <Flole998@users.noreply.github.com>
Sat, 11 Jul 2020 21:49:41 +0000 (23:49 +0200)
committerGitHub <noreply@github.com>
Sat, 11 Jul 2020 21:49:41 +0000 (23:49 +0200)
As proposed in #1332

src/dvr/dvr_db.c
src/htsp_server.c

index 701211850e4296859136b67b0792492cd2ae6b30..7205b170df244565149b4c30144f1224fd6e34ae 100644 (file)
@@ -3077,6 +3077,8 @@ dvr_entry_class_save(idnode_t *self, char *filename, size_t fsize)
             htsmsg_add_s64(c, "start", s64);
           if (!htsmsg_get_s64(e, "stop", &s64))
             htsmsg_add_s64(c, "stop", s64);
+          if (!htsmsg_get_s64(e, "size", &s64))
+            htsmsg_add_s64(c, "size", s64);
           htsmsg_add_msg(l, NULL, c);
         }
       }
index 5629fc147c9e447f12358c38c7eb30c922ee7c76..4ec0a90ff4874967661ff738a48c0bc466948c9f 100644 (file)
@@ -50,7 +50,7 @@
 
 static void *htsp_server, *htsp_server_2;
 
-#define HTSP_PROTO_VERSION 34
+#define HTSP_PROTO_VERSION 35
 
 #define HTSP_ASYNC_OFF  0x00
 #define HTSP_ASYNC_ON   0x01
@@ -955,7 +955,7 @@ htsp_build_dvrentry(htsp_connection_t *htsp, dvr_entry_t *de, const char *method
   htsmsg_field_t *f;
   const char *s = NULL, *error = NULL, *subscriptionError = NULL;
   const char *p, *last;
-  int64_t fsize = -1, start, stop;
+  int64_t fsize = -1, start, stop, size;
   uint32_t u32;
   char buf[512];
   char ubuf[UUID_HEX_SIZE];
@@ -1062,6 +1062,8 @@ htsp_build_dvrentry(htsp_connection_t *htsp, dvr_entry_t *de, const char *method
             htsmsg_set_s64(e, "start", start);
           if (!htsmsg_get_s64(m, "stop", &stop))
             htsmsg_set_s64(e, "stop", stop);
+          if (!htsmsg_get_s64(m, "size", &size))
+            htsmsg_set_s64(e, "size", size);
 
           htsmsg_add_msg(l, NULL, e);
         }