Project

General

Profile

Actions

Bug #4020

closed

API File moving not working: /api/dvr/entry/filemoved

Added by Rob M over 8 years ago. Updated over 8 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
API
Target version:
-
Start date:
2016-10-12
Due date:
% Done:

100%

Estimated time:
Found in version:
version 4.1-2270~g9e85ef2
Affected Versions:

Description

I have been struggling to use the API for moving a file working and I am not sure if it is user or application error:

I get back either 400 Bad Request or nothing. Note for the following examples I have been escaping the special characters as per the instructions:
https://tvheadend.org/issues/3818

I have tried the following:

root@tvheadend:/home/hts/Test# ls -l *
test1:
total 92944
-rw-r--r-- 1 hts hts 95173684 Oct 12 12:26 test.ts

test2:
total 185888
-rw-r--r-- 1 hts hts 95173684 Oct 12 12:31 test1.ts
-rw-r--r-- 1 hts hts 95173684 Oct 12 12:11 test.ts
root@tvheadend:/home/hts/Test# 

Allow Tvheadend to move the file:
http://tvheadend.internal:9981/api/dvr/entry/filemoved?src=/home/hts/Test/test2/test.ts&dst=/home/hts/Test/test1/test.ts

Copy the file manually and run the above URL - This gives no response from the server and Tvheadend still looks at the original file
Move the file manually and run the above URL - This gives a 400 error and Tvheadend moves the recording to failed (as the file no longer is there)

I have tried escaping the "/" (on all examples as I believe this is the correct way):
http://tvheadend.internal:9981/api/dvr/entry/filemoved?src=%2Fhome%2Fhts%2FTest%2Ftest2%2Ftest.ts&dst=%2Fhome%2Fhts%2FTest%2Ftest1%2Ftest.ts

I have tried just renaming the file (so not moving out of the directory) - This gives a 400 error
http://tvheadend.internal:9981/api/dvr/entry/filemoved?src=/home/hts/Test/test2/test.ts&dst=/home/hts/Test/test2/test1.ts

Tried putting relative paths (omitting /home/hts) - This gives a 400 error.
http://tvheadend.internal:9981/api/dvr/entry/filemoved?src=/Test/test2/test.ts&dst=/Test/test2/test1.ts

I have managed to crash the server using this as well (only once so far, so maybe not an issue):

2016-10-12 10:56:03.970 [  ALERT]:CRASH: Signal: 11 in PRG: /usr/bin/tvheadend (4.1-2270~g9e85ef2) [33cd24b5bbe785b6a94bb34e2335a9a1ca8323b7] CWD: /
2016-10-12 10:56:03.970 [  ALERT]:CRASH: Fault address (nil) (Address not mapped)
2016-10-12 10:56:03.970 [  ALERT]:CRASH: Loaded libraries: /usr/lib/x86_64-linux-gnu/libdvbcsa.so.1 /lib/x86_64-linux-gnu/libssl.so.1.0.0 /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 /lib/x86_64-linux-gnu/libz.so.1 /usr/lib/x86_64-linux-gnu/liburiparser.so.1 /usr/lib/x86_64-linux-gnu/libavahi-common.so.3 /usr/lib/x86_64-linux-gnu/libavahi-client.so.3 /lib/x86_64-linux-gnu/libdbus-1.so.3 /lib/x86_64-linux-gnu/libdl.so.2 /lib/x86_64-linux-gnu/libpthread.so.0 /lib/x86_64-linux-gnu/libm.so.6 /lib/x86_64-linux-gnu/librt.so.1 /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /lib/x86_64-linux-gnu/libc.so.6 /lib/x86_64-linux-gnu/libsystemd.so.0 /lib64/ld-linux-x86-64.so.2 /lib/x86_64-linux-gnu/libgcc_s.so.1 /lib/x86_64-linux-gnu/libselinux.so.1 /lib/x86_64-linux-gnu/liblzma.so.5 /lib/x86_64-linux-gnu/libgcrypt.so.20 /lib/x86_64-linux-gnu/libpcre.so.3 /lib/x86_64-linux-gnu/libgpg-error.so.0 /lib/x86_64-linux-gnu/libnss_compat.so.2 /lib/x86_64-linux-gnu/libnsl.so.1 /lib/x86_64-linux-gnu/libnss_nis.so.2 /lib/x86_64-linux-gnu/libnss_files.so.2 
2016-10-12 10:56:03.970 [  ALERT]:CRASH: Register dump [23]: 000055b6f4587020000055b6f2920ee000007f1fc0051f100000000000000202000055b6f8745a4000007f1fc005888c00007f1fc0051f6c00000000ffffffff000000000000000000007f1fc005888c000055b6f8746110000055b6f87460f00000000000000000000000000000088c000000000000005400007f1fb97f11c800007f1ff06a0b5a000000000001028700000000000000330000000000000004000000000000000efffffffe7ffbba130000000000000000
2016-10-12 10:56:03.970 [  ALERT]:CRASH: STACKTRACE
2016-10-12 10:56:04.087 [  ALERT]:CRASH: ??:0 0x55b6f28f750d
2016-10-12 10:56:04.091 [  ALERT]:CRASH: ??:0 0x7f1ff126f3d0
2016-10-12 10:56:04.096 [  ALERT]:CRASH: ??:0 0x7f1ff06a0b5a
2016-10-12 10:56:04.100 [  ALERT]:CRASH: ??:0 0x55b6f2939bea
2016-10-12 10:56:04.105 [  ALERT]:CRASH: ??:0 0x55b6f2920f1f
2016-10-12 10:56:04.109 [  ALERT]:CRASH: ??:0 0x55b6f294baef
2016-10-12 10:56:04.113 [  ALERT]:CRASH: ??:0 0x55b6f28c9db2
2016-10-12 10:56:04.117 [  ALERT]:CRASH: ??:0 0x55b6f28cab2a
2016-10-12 10:56:04.121 [  ALERT]:CRASH: ??:0 0x55b6f28cad1d
2016-10-12 10:56:04.125 [  ALERT]:CRASH: ??:0 0x55b6f28ca362
2016-10-12 10:56:04.129 [  ALERT]:CRASH: ??:0 0x55b6f28cafd3
2016-10-12 10:56:04.133 [  ALERT]:CRASH: ??:0 0x55b6f28cb111
2016-10-12 10:56:04.137 [  ALERT]:CRASH: ??:0 0x55b6f28c37dd
2016-10-12 10:56:04.141 [  ALERT]:CRASH: ??:0 0x55b6f28bf135

My end goal is to move the recordings into a sub directories to split out the recordings between family groups:

RobsTV/<title>/<episode>
KidsTV/<title>/<episode>

In Kodi this means that I am not presented with a list of titles that are for me or for the kids, we all have our own top level groups. This works if I do things manually, but would require a restart... I want to be able to kick this off after a recording.

Actions

Also available in: Atom PDF