NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Add-ons (3rd party plugins, utilities and skins) v
1 2 3 4 5 … 20 Next »
Update NPVR Database with UniqueID element using NextTool

 
  • 0 Vote(s) - 0 Average
Update NPVR Database with UniqueID element using NextTool
ChrisHammond56
Offline

Junior Member

Posts: 39
Threads: 5
Joined: Mar 2015
#1
2022-08-16, 10:49 PM
Hello. I have been in separate discussions about recurring re-recordings, and I think it is because the UniqueID element is missing from the Event column of SCHEDULED_RECORDINGS.

I can see from the XML generated at the time of recording (and in the scheduled recording, before the recording starts) that the UniqueID element is populated. What I now want to do is use NextTool to update the Database with the UniqueID from the XML.

I have tried --importXML, which works great if the recording is not there (which then includes UniqueID), however, if the recording exists, then the metadata is not updated. I have also tried the --file, and this provides the same result, as the recording exists.

What I really need is a way to use NextTool to perform this command on the Database, by providing the recording name (example '/recordings/tv/path-to-series/episode-name.mkv') and the uniqueid (example 'EP013032340098')

This is the command I used in sqlite to achieve my goal:

UPDATE SCHEDULED_RECORDING SET event_details = REPLACE(event_details, '</Event>', '  <UniqueID>EP013032340098</UniqueID>
</Event>') WHERE event_details NOT LIKE 'UniqueID' AND filename LIKE '/recordings/tv/path-to-series/episode-name.mkv';

Something like this would be useful to me.

dotnet NextTool.dll --importUID "/recordings/tv/path-to-series/episode-name.mkv" EP013032340098

Is there any possibility of getting this added to the tool?
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,818
Threads: 954
Joined: May 2006
#2
2022-08-17, 12:21 AM (This post was last modified: 2022-08-17, 12:24 AM by mvallevand.)
I am not planning on adding that but I think if you add the unique id to episode-name.xml file this should do it now.

dotnet NextTool.dll --file "/recordings/tv/path-to-series/episode-name.mkv"

importXML is anothere bulk load format, the --import and --file use the side-by-side import that NextPVR generates and you can create too.

Martin
ChrisHammond56
Offline

Junior Member

Posts: 39
Threads: 5
Joined: Mar 2015
#3
2022-08-17, 09:44 PM
That is what I was trying to do (use --importXML or --file) however, they do not update the uid

In the case of --importXMl, I get this:
root@nextpvr:/app# dotnet NextTool.dll --importxml "/recordings/tv/Father Brown/Season 08/Father Brown S08E01 The Celestial Choir.xml"

NEXTPVR_INSTALLDIR /app/
NEXTPVR_DATADIR /app/data/
NEXTPVR_DATADIR_USERDATA /config/

Log file contains:
[...startup]
2022-08-17 22:32:43.375 [DEBUG][1] NextTool, Version=1.1.10.0, Culture=neutral, PublicKeyToken=null
2022-08-17 22:32:43.403 [INFO][1] Using remote RecordingService
2022-08-17 22:32:43.405 [DEBUG][1] Database: /config/npvr.db3
2022-08-17 22:32:43.611 [INFO][1] --importxml /recordings/tv/Father Brown/Season 08/Father Brown S08E01 The Celestial Choir.xml
2022-08-17 22:32:43.627 [DEBUG][1] Import Recordings...
2022-08-17 22:32:43.742 [DEBUG][1] - recording already exists for file:/recordings/tv/Father Brown/Season 08/Father Brown S08E01 The Celestial Choir.mkv
2022-08-17 22:32:43.742 [DEBUG][1] Import Recordings@exit: No recordings imported.

And in the case of --file I get this error:

root@nextpvr:/app# dotnet NextTool.dll --file "/recordings/tv/Father Brown/Season 08/Father Brown S08E01 The Celestial Choir.mkv"
NEXTPVR_INSTALLDIR /app/
NEXTPVR_DATADIR /app/data/
NEXTPVR_DATADIR_USERDATA /config/
File is already in the database
System.NullReferenceException: Object reference not set to an instance of an object.
  at NextTool.MetaXML..ctor(String filename, Nullable`1 filesize)
Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
  at NextTool.Program.ProcessOneFile(String filename)
  at NextTool.Program.Main(String[] args)
  at NextTool.Program.<Main>(String[] args)
Aborted (core dumped)

Log contains:
[...startup]
2022-08-17 22:34:05.103 [DEBUG][1] NextTool, Version=1.1.10.0, Culture=neutral, PublicKeyToken=null
2022-08-17 22:34:05.129 [INFO][1] Using remote RecordingService
2022-08-17 22:34:05.130 [DEBUG][1] Database: /config/npvr.db3
2022-08-17 22:34:05.327 [INFO][1] --file /recordings/tv/Father Brown/Season 08/Father Brown S08E01 The Celestial Choir.mkv

This is the XML that was attempted to be imported:
<?xml version="1.0" encoding="UTF-8"?>

<recording>
  <filename>/recordings/tv/Father Brown/Season 08/Father Brown S08E01 The Celestial Choir.mkv</filename>
  <channel>alibi HD</channel>
  <status>READY</status>
  <startTime>2022-04-07 13:00:02</startTime>
  <endTime>2022-04-07 13:45:02</endTime>
  <size>4204390308</size>
  <channel_OID>7373</channel_OID>
  <title>Father Brown</title>
  <subtitle>The Celestial Choir</subtitle>
  <description>A mysterious saboteur tries to stop Kembleford winning the Three Counties choir competition.</description>
  <uid>EP016736560083</uid>
  <firstrun>false</firstrun>
  <original_air_date>2020-01-06T00:00:00.0000000</original_air_date>
  <season>8</season>
  <episode>1</episode>
  <audio>stereo</audio>
  <quality>HDTV</quality>
</recording>

I am stuck as to how to update the UID in the SCHEDULED_RECORDINGS table

Thanks
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,818
Threads: 954
Joined: May 2006
#4
2022-08-17, 10:11 PM (This post was last modified: 2022-08-17, 10:32 PM by mvallevand.)
You need to read my messages carefully since there is a big difference between--import and --importxml

The crash is because I am expecting genre in there (even though it doesn't update) so for now it needs but I have fixed it for the next release.

Code:
.
  <genres>
  </genres>

Like genres, the unique_is not updated if it is there, but I think I only started updating that in the netcore 6 version of NextTool

Martin
ChrisHammond56
Offline

Junior Member

Posts: 39
Threads: 5
Joined: Mar 2015
#5
2022-08-17, 11:35 PM
Adding <Genres> and </Genres> fixed the exception. --file completes now, but still doesn't update the uid:

root@nextpvr:/app# dotnet NextTool.dll --file "/recordings/tv/Father Brown/Season 08/Father Brown S08E02 The Queen Bee.mkv"
NEXTPVR_INSTALLDIR /app/
NEXTPVR_DATADIR /app/data/
NEXTPVR_DATADIR_USERDATA /config/
File is already in the database

[...startup]
2022-08-18 00:06:55.149 [DEBUG][1] NextTool, Version=1.1.10.0, Culture=neutral, PublicKeyToken=null
2022-08-18 00:06:55.178 [INFO][1] Using remote RecordingService
2022-08-18 00:06:55.179 [DEBUG][1] Database: /config/npvr.db3
2022-08-18 00:06:55.379 [INFO][1] --file /recordings/tv/Father Brown/Season 08/Father Brown S08E02 The Queen Bee.mkv

I also tried --import, same result. no uid field update:
root@nextpvr:/app# dotnet NextTool.dll --import "/recordings/tv/Father Brown/Season 08/"
NEXTPVR_INSTALLDIR /app/
NEXTPVR_DATADIR /app/data/
NEXTPVR_DATADIR_USERDATA /config/
Folder: Season 08

[...startup]
2022-08-18 00:15:55.384 [DEBUG][1] NextTool, Version=1.1.10.0, Culture=neutral, PublicKeyToken=null
2022-08-18 00:15:55.410 [INFO][1] Using remote RecordingService
2022-08-18 00:15:55.411 [DEBUG][1] Database: /config/npvr.db3
2022-08-18 00:15:55.605 [INFO][1] --import /recordings/tv/Father Brown/Season 08/
2022-08-18 00:15:55.625 [INFO][1] Folder: Season 08

I have re-read your instructions, I must be missing something?

- Chris
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,818
Threads: 954
Joined: May 2006
#6
2022-08-17, 11:43 PM
You are missing the new version for sure. --import will only bring in the unique_id on new imports and as I noted --file is probably not fully working in v5.

Ideally when you get the new version you will just use the command to get them on demand so you don't have to look them up.

Martin
ChrisHammond56
Offline

Junior Member

Posts: 39
Threads: 5
Joined: Mar 2015
#7
2022-08-17, 11:48 PM
Thanks. v6 schedule????
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,648
Threads: 767
Joined: Nov 2003
#8
2022-08-18, 03:29 AM
(2022-08-17, 11:48 PM)ChrisHammond56 Wrote: v6 schedule????
Unsure at this stage. I had intended to get it out a month or so ago, but I've been busy with other non-NextPVR stuff and haven't found the time. It's largely done, just a couple of small things I need to revisit.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  NextTool Error greg in kansas 4 230 2025-04-04, 03:35 PM
Last Post: greg in kansas
  NextTool Unhandled exception jrshan9 4 412 2024-12-11, 10:56 PM
Last Post: jrshan9
  NextTool queue processing mvallevand 0 834 2023-06-26, 01:12 AM
Last Post: mvallevand
  NextTool for Windows question MrReis 12 2,283 2023-03-31, 10:23 PM
Last Post: mvallevand
  NextTool import Dale Dewing 13 3,056 2023-01-31, 02:54 PM
Last Post: mvallevand
  Nexttool brady@preheim.com 1 1,331 2022-11-22, 08:26 AM
Last Post: mvallevand
  new format for NextTool import? spagio 7 2,183 2022-08-11, 01:17 PM
Last Post: mvallevand
  issue for NextTool on Linux spagio 3 1,502 2022-05-14, 09:34 PM
Last Post: mvallevand
  VideoConduit - Standalone App to Import Lost TV Recordings into NPVR 27InchSony 54 23,927 2021-12-29, 10:08 PM
Last Post: mvallevand
  imageGrabLite update mvallevand 20 13,655 2020-04-04, 02:42 AM
Last Post: jksmurf

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode