sengsational / cwhelper

The code here is the background job for CW_EPG, an electronic program guide / DVR for Windows
1 stars 1 forks source link

Http capture type fails if directory does not already exist #37

Closed sengsational closed 1 week ago

sengsational commented 1 week ago

This is on a Win11 VM with no S.D. support loaded. I scheduled a VCR-type recording and it failed (after trying all the available tuners 😊) evidently because the HTTP interface was missing a component.

    Sun Nov 10 22:01:57 PST 2024 Logging to files in C:\ProgramData\CW_EPG\logs as dictated by the path found by System.getenv("ProgramData") method
    Sun Nov 10 22:01:57 PST 2024 WARNING: hdhomerun_config.exe not found in C:\Program Files\WindowsApps\57870CliffWatsonEPGTeam.CliffWatsonEPGProgram_5.4.182.0_x86__mc88n03vh6xa2\ as dictated by the path found in registry HKEY_LOCAL_MACHINE\SOFTWARE\CW_EPG\cwepgfolder
    Sun Nov 10 22:01:57 PST 2024 WARNING: Captures will only work on tuners with the http interface.
    …
    /capture?channelname=4.1&datetime=11/12/24%20%2010:45:00&datetimeend=11/12/24%20%2010:55:00&filename=C:%5CHDHomerun%20Captures%5CManually%20Scheduled%20Capture.ts&tuner=1075D4B1-0&title=Manually%20Scheduled%20Capture HTTP/1.1] 10:44:11
    channelname [4.1]
    channelvirtual [null]
    datetime [11/12/24  10:45:00]
    datetimeend [11/12/24  10:55:00]
    durationminutes [null]
    tuner [1075D4B1-0]
    filename [C:\HDHomerun Captures\Manually Scheduled Capture.ts]
    title [Manually Scheduled Capture]
    protocol [null]
    rfchannel [null]
    recurring [null]
    slot [Slot: start [11/12/24 10:45:00] stop [11/12/24 10:54:59]]
    getCaputureForChannelNameSlotAndTuner(4.1, Slot: start [11/12/24 10:45:00] stop [11/12/24 10:54:59], 1075D4B1-0, null
    Tue Nov 12 10:44:11 PST 2024 Found channel match on 1075D4B1-0's lineup for channelName: 4.1 protocol: null
    Tue Nov 12 10:44:11 PST 2024 Scheduled with [4.1] [1075D4B1-0] [null]
    Tue Nov 12 10:44:11 PST 2024 The path for targetFileName 'C:\HDHomerun Captures\Manually Scheduled Capture.ts' does not exist. Checking ability to create the path.
    Tue Nov 12 10:44:11 PST 2024 INFO: Path [C:\HDHomerun Captures] is writable. Temp file deleted.
    Tue Nov 12 10:44:11 PST 2024 Path removed.
    Tue Nov 12 10:44:11 PST 2024 open slot:true file name:true file path:true
    Tue Nov 12 10:44:11 PST 2024 CaptureManager.scheduleCapture(newCapture, true)
    writing capture Capture [ChannelDigital [4.1 KRON-TV 4.1 KRON-TV fav:false sourceId: pid:1 freq:4 proto:8vsb virt:4.1 input:1 1075D4B1-0 (8vsb 4) 6170006.0]] [Slot: start [11/12/24 10:45:00] stop [11/12/24 10:54:59]] start/end [false/false] target [192.168.1.74:0 C:\HDHomerun Captures\Manually Scheduled Capture.ts Manually Scheduled Capture Win11VM]
    Tue Nov 12 10:44:11 PST 2024 >>> CaptureManager.run() resetting sleep time. Interupted by:Tue Nov 12 10:44:11 PST 2024 TinyConnection.run (/capture) ok.
    Tue Nov 12 10:44:11 PST 2024 set to allow machine to sleep        (0x80000000). RC: (0x80000000). Thread: main
    …
    Tue Nov 12 10:45:06 PST 2024 CaptureManager.run() secondSleep ended.
    Tue Nov 12 10:45:06 PST 2024 HttpProcess not available java.io.FileNotFoundException C:\HDHomerun Captures\Manually Scheduled Capture.ts (The system cannot find the path specified)
    Tue Nov 12 10:45:06 PST 2024 WARNING: Device for capture was unavailable! The device is not available. 192.168.1.16 tuner0 v4.1 C:\HDHomerun Captures\Manually Scheduled Capture.ts
    Tue Nov 12 10:45:06 PST 2024 Attempting to define and schedule a replacement for [Capture [ChannelDigital [4.1 KRON-TV 4.1 KRON-TV fav:false sourceId: pid:1 freq:4 proto:8vsb virt:4.1 input:1 1075D4B1-0 (8vsb 4) 6170006.0]] [Slot: start [11/12/24 10:45:00] stop [11/12/24 10:54:59]] start/end [false/false] target [192.168.1.74:55100
    …

After this is the trail of failures on all the extant tuners that all stem from “HttpProcess not available”.

I repeated the experiment after manually creating C:\HDHomerun Captures and the capture succeeded:

Does this all immediately make sense and suggest a fix to you?

sengsational commented 1 week ago

Tested ok and change merged.