kmahon37 / plex-dvr-waker

Plex DVR Waker is a simple command-line tool for waking the computer before the next scheduled recording.
MIT License
8 stars 0 forks source link

[BUG] IndexOutOfRangeException when running `wakeup` task #4

Closed kmahon37 closed 4 years ago

kmahon37 commented 4 years ago

Describe the bug From user "atkinplex" via Plex Forums:

Hi Kris Thanks for writing the PlexDVRWaker. I’ve tried using scan and it didn’t wake up my Windows 10 HTPC. I’m trying monitor now to see if that makes a difference. I could see either scan or monitor in task scheduler, but if I run wakeup I get this error:

Unhandled Exception: System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at PlexDvrWaker.Plex.DataAdapter.<>c.<LoadSubscriptions>b__13_1(String s) in C:\Users\Kris\Documents\Code\GitHub\plex-dvr-waker\Plex\DataAdapter.cs:line 204
   at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](TSource[] source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
   at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
   at PlexDvrWaker.Plex.DataAdapter.LoadSubscriptions() in C:\Users\Kris\Documents\Code\GitHub\plex-dvr-waker\Plex\DataAdapter.cs:line 201
   at PlexDvrWaker.Plex.DataAdapter.GetScheduledRecordings() in C:\Users\Kris\Documents\Code\GitHub\plex-dvr-waker\Plex\DataAdapter.cs:line 37
   at PlexDvrWaker.Plex.DataAdapter.GetNextScheduledRecordingTime() in C:\Users\Kris\Documents\Code\GitHub\plex-dvr-waker\Plex\DataAdapter.cs:line 74
   at PlexDvrWaker.Plex.DataAdapter.GetNextWakeupTime() in C:\Users\Kris\Documents\Code\GitHub\plex-dvr-waker\Plex\DataAdapter.cs:line 102
   at PlexDvrWaker.Program.RunAddTask(AddTaskOptions options) in C:\Users\Kris\Documents\Code\GitHub\plex-dvr-waker\Program.cs:line 61
   at PlexDvrWaker.Program.Main(String[] args) in C:\Users\Kris\Documents\Code\GitHub\plex-dvr-waker\Program.cs:line 31

To Reproduce

  1. Run the wakeup task

Expected behavior It should not error.

Desktop (please complete the following information):

kmahon37 commented 4 years ago

Fixed in v1.1.1.