Request : Plex Style Database

My Channels DVR is a Mac as well. How are you "bulk deleting"?

Good information thanks. I can put this to good use. I never even thought to check if it could be done.

Where are you entering this command? I do pretty much everything in the browser backend. I'd really like to see a button in the browser DVR settings to "prune" the database. But again, I'm not deleting IN Channels, but with Infuse so I don't know if Channels actually KNOWS the shows have been deleted unless of course it rescans the library.

From whatever REST client you like. For example:

curl -XPUT http://${DVR_IP}:8089/dvr/pruner/deleted

Or,

Invoke-WebRequest -Method PUT -Uri "http://${DVR_IP}:8089/dvr/pruner/deleted"

Just following up . . . I tried this and mostly got errors (specifically "missing }". Assuming that was for example purposes (I'm not a coder) when I removed the brackets altogether, it put ALL of my recordings into the Trash folder so I had to manually restore them.

So I'm back to looking for a way to prune recordings from the recording database when deleting the files using another app.

Does this work? I may end up creating a cron job for this.

It didn't work for me, but again I may have done something wrong. It literally put ALL of my recordings into the Trash (in Channels). I don't need that to be done . . . I need the database to update when I remove the files though another method. Otherwise I have to go back into Channels and remove them manually after I've watched them in another app.

What is the exact command you ran?

The only way it should have trashed everything is if all those files were missing on your disk.

Does the dvr Log show it trashing every recording? What is the message shown?

I attempted to run :

curl -XPUT http://${192.168.100.205}:8089/dvr/pruner/deleted (which is my local server IP - Mac Mini). I ran this in Terminal. I got an error stating "missing }"

I then tried to run

curl -XPUT http://:8089$192.168.100.205/dvr/pruner/deleted (brackets removed in case that was improper syntax). I got an error that host $ couldn't be found.

Then I removed the $ and ran

curl -XPUT http://192.168.100.205:8089/dvr/pruner/deleted

At that point all of my records were moved into the Deleted Folder and I had to go through and hit the Restore button to get them back into the "database". Again, not certain what I changed that caused the problem, but I decided to stop trying. I've added the part of the log that would encompass this time frame.

2021/02/13 09:35:31.373272 [IDX] Pruned 61 expired groups from USA-OTA55106 in 17.336178ms.
2021/02/13 09:35:31.390561 [IDX] Pruned 165 expired groups from X-TVE in 17.235473ms.
2021/02/13 09:35:31.483290 [IDX] Pruned 1519 expired airings from USA-OTA55106 in 75.976463ms.
2021/02/13 09:35:31.488747 [DVR] Rule 'American Idol' (7) found 1 new airings
2021/02/13 09:35:31.517293 [DVR]   queued recording job for EP005520800707 @ Sun Feb 28 7:00:00PM (1614560400-7)
2021/02/13 09:35:31.557358 [IDX] Pruned 2921 expired airings from X-TVE in 71.470808ms.
2021/02/13 09:35:31.592672 [DVR] Rule 'Meet the Press' (11) found 1 new airings
2021/02/13 09:35:31.607231 [DVR]   queued recording job for EP000028661531 @ Sun Feb 28 9:00:00AM (1614524400-11)
2021/02/13 09:35:31.624933 [DVR] Rule 'The Rookie' (12) found 1 new airings
2021/02/13 09:35:31.639114 [DVR]   queued recording job for EP029705430048 @ Sun Feb 28 9:00:00PM (1614567600-12)
2021/02/13 09:35:31.714078 [DVR] Rule 'Home Town' (19) found 3 new airings
2021/02/13 09:35:31.731623 [DVR]   queued recording job for EP023504120105 @ Sun Feb 21 7:00:00PM (1613955600-19)
2021/02/13 09:35:31.749782 [DVR]   queued recording job for EP023504120128 @ Sun Feb 28 7:00:00PM (1614560400-19)
2021/02/13 09:35:31.763187 [DVR]   queued recording job for EP023504120116 @ Sun Feb 28 8:00:00PM (1614564000-19)
2021/02/13 09:35:31.946356 [DVR] Deleting job with expired serial: 1613248200-8 MotorWeek (EP000029601674)
2021/02/13 09:35:31.961082 [DVR] Waiting 2h24m28.038925s until next job 1613239200-ch6054 The Foreigner (2017)
2021/02/13 09:35:32.406484 [DVR] Waiting 2h24m27.593521s until next job 1613239200-ch6054 The Foreigner (2017)
2021/02/13 10:00:00.457783 [TNR] Closed connection to 107AD6A9/0 for ch23.1 The CW
2021/02/13 10:00:00.462774 [SNR] Statistics for "TV/This Old House Trade School/This Old House Trade School S01E13 2018-02-17 Follow the Winding Brick Path 2021-02-13-0930.mpg": ss=100% snq=99%,0%-100% seq=99%,0%-100% bps=12285712,1910080-13739040 pps=1164,182-1305
2021/02/13 10:00:00.465552 [DVR] Finished job 1613230200-10 This Old House: Trade School
2021/02/13 10:00:00.482826 [DVR] Waiting 1h59m59.517184s until next job 1613239200-ch6054 The Foreigner (2017)
2021/02/13 10:00:00.532433 [DVR] Processing file-1104: TV/This Old House Trade School/This Old House Trade School S01E13 2018-02-17 Follow the Winding Brick Path 2021-02-13-0930.mpg
2021/02/13 10:00:00.902510 [DVR] Running commercial detection on file 1104 (TV/This Old House Trade School/This Old House Trade School S01E13 2018-02-17 Follow the Winding Brick Path 2021-02-13-0930.mpg)
2021/02/13 10:02:51.154333 [DVR] Commercial detection for This Old House Trade School S01E13 2018-02-17 Follow the Winding Brick Path 2021-02-13-0930.mpg finished with 10 markers.
2021/02/13 11:59:59.944524 [DVR] Waiting 55.488ms until next job 1613239200-ch6054 The Foreigner (2017)
2021/02/13 12:00:00.017143 [DVR] Starting job 1613239200-ch6054 The Foreigner (2017) on ch=[6054]
2021/02/13 12:00:00.017209 [DVR] Waiting 1h29m59.982795s until next job 1613244600-3 Cook's Country
2021/02/13 12:00:00.019317 [TVE] action=auth mvpd=Comcast_SSO requestor=syfy
2021/02/13 12:00:01.550723 [TVE] action=error_response type=Other error=net::ERR_UNKNOWN_URL_SCHEME
2021/02/13 12:00:01.552561 [TVE] action=mock
2021/02/13 12:00:01.553296 [TVE] action=navigate url=https://sp.auth.adobe.com/adobe-services/authenticate/saml?noflash=true&mso_id=Comcast_SSO&requestor_id=syfy&no_iframe=true&domain_name=adobe.com&redirect_url=https%3A%2F%2Fsp.auth.adobe.com%2Fadobe-services%2FcompletePassiveAuthentication
2021/02/13 12:00:01.554926 [TVE] action=request type=Document method=GET url=https://sp.auth.adobe.com/adobe-services/authenticate/saml
2021/02/13 12:00:01.956540 [TVE] action=request type=Document method=GET url=https://oauth.xfinity.com/oauth/authorize
2021/02/13 12:00:02.224078 [TVE] action=request type=Document method=GET url=https://login.xfinity.com/login
2021/02/13 12:00:02.224129 [TVE] action=auth_domain domain=login.xfinity.com
2021/02/13 12:00:02.631588 [TVE] action=wait_for_page
2021/02/13 12:00:09.713121 [TVE] action=page_ready
2021/02/13 12:00:09.713758 [TVE] action=wait_for_page done=true reason=page_ready
2021/02/13 12:00:09.713879 [TVE] action=fill_form [email protected]
2021/02/13 12:00:09.923453 [TVE] action=request type=Document method=POST url=https://login.xfinity.com/login
2021/02/13 12:00:09.924897 [TVE] action=wait_for_auth
2021/02/13 12:00:11.026449 [TVE] action=request type=Document method=GET url=https://oauth.xfinity.com/oauth/authorize
2021/02/13 12:00:11.434345 [TVE] action=request type=Document method=GET url=https://sp.auth.adobe.com/adobe-services/oauth2
2021/02/13 12:00:12.220852 [TVE] action=request type=Document method=GET url=https://sp.auth.adobe.com/adobe-services/completePassiveAuthentication
2021/02/13 12:00:12.220901 [TVE] action=authed
2021/02/13 12:00:12.223696 [TVE] action=cookies num_domains=2 num_cookies=19
2021/02/13 12:00:12.227203 [TVE] action=error_response type=Document error=net::ERR_ABORTED
2021/02/13 12:00:14.231335 [TNR] Opened connection to TVE-Comcast_SSO for ch6054 SYFY
2021/02/13 12:00:14.232393 [DVR] Recording for job 1613239200-ch6054 from TVE-Comcast_SSO ch6054 into "Movies/The Foreigner (2017) 2021-02-13-1200.mpg" for 2h29m59.982725s
2021/02/13 12:00:14.257238 [IDX] Generating video index for job 1613239200-ch6054
2021/02/13 13:30:00.026458 [DVR] Starting job 1613244600-3 Cook's Country on ch=[2.1]
2021/02/13 13:30:00.027020 [DVR] Waiting 19h29m59.97299s until next job 1613314800-11 Meet the Press

Omit the ${ and }. Your command should be:

curl -XPUT http://192.168.100.205:8089/dvr/pruner/deleted

(Note: When giving commands with variables, $VARIABLE is equivalent to ${VARIABLE}. The curly braces are used just in case the variable has no whitespace around it, and/or the variable's name might be ambiguous.)

Thank you. That was the third attempt that I ran which ended up putting all of my recordings INTO the Trash. I was not looking for a command to move all of my recordings . . . I'm looking to have the DVR database update itself with by removing the files in already in the Trash and therefore only keeping a record of those items still in the TV and Movies folder.

I think this might be what you're looking for:

Thank you. I'll try that after I watch a few more shows. As much as I don't know coding, that command makes sense. :slight_smile:

Updating the program database is not related to what you're trying to do.

That still didn't accomplish what I'm looking for. I watched and deleted 3 movies using Infuse and removed them from the Trash on the server so they don't exist ANYWHERE on the server. Plex and Infuse no longer list them, but Channels does athough of course there is an error if I attempt to watch them.

What I'd like is something that will force Channels to recognize / rebuild it's database to reflect only those shows and movies that actually exist in the DVR/TV and DVR/Movies folders. I don't want to have to go back into Channels to manually remove entries that have already been deleted by another application. Thanks!

POST /dvr/programs/regenerate, as previously mentioned. You weren't clear previously about what you were trying to do. I think this is the first time you've mentioned that you are using a different program to delete Channels' recordings.

EDIT: As pointed out by Aman below, I was confusing posts. The relevant link to a previous discussion is here:

Well, you're manually managing/deleting programs that Channels thinks it owns. The short answer is, Don't do that.

Long answer: Better batch file operations (including deletion) are supposed to be implemented this year. But, if you mess with files that a program thinks it owns, you shouldn't be surprised when things go awry.

The programs database is not related to what OP is trying to do here.

@jthawke Please open http://192.168.100.205:8089/dvr/pruner/deleted in a browser then click file>save and email to [email protected] along with a link to this forum thread.

1 Like

I just sent the email and JSON file to support. Thank you.

To be fair, I'm not at all surprised that Channels is holding onto it's "memory" of these recordings which is specifically why I am requesting a database function more similar to Plex that is dynamic based upon the folder contents. It obviously doesn't work this way currently, but would be nice if it could in the future.

After some discussion with support and testing, you were correct initially. While I assumed Channels was deleting files, it was only deleting placeholders. The curl command does work as expected and will place the "deleted" files in the Channels trash to be auto removed the following day. I can set a cron job on the server to do this daily and I won't have to manually remove from Channels.

I apologize for the mixup.