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] List command returns SQL error #2

Closed csmalt closed 4 years ago

csmalt commented 4 years ago

Describe the bug Running list command returns an SQL error. Plex data is stored in the default location.

dotnet PlexDvrWaker.dll list --verbose
2019-10-01T19:31:07     Getting scheduled recordings
2019-10-01T19:31:07       Loading subscriptions
2019-10-01T19:31:07       Loading EPG info for subscriptions

Unhandled Exception: System.Data.SQLite.SQLiteException: SQL logic error
near ";": syntax error
   at System.Data.SQLite.SQLite3.Prepare(SQLiteConnection cnn, String strSql, SQLiteStatement previous, UInt32 timeoutMS, String& strRemain)
   at System.Data.SQLite.SQLiteCommand.BuildNextCommand()
   at System.Data.SQLite.SQLiteDataReader.NextResult()
   at System.Data.SQLite.SQLiteDataReader..ctor(SQLiteCommand cmd, CommandBehavior behave)
   at System.Data.SQLite.SQLiteCommand.ExecuteReader(CommandBehavior behavior)
   at PlexDvrWaker.Plex.DataAdapter.LoadEpgInfo() in C:\Users\Kris\Documents\Code\GitHub\plex-dvr-waker\Plex\DataAdapter.cs:line 232
   at PlexDvrWaker.Plex.DataAdapter.GetScheduledRecordings() in C:\Users\Kris\Documents\Code\GitHub\plex-dvr-waker\Plex\DataAdapter.cs:line 56
   at PlexDvrWaker.Plex.DataAdapter.PrintScheduledRecordings() in C:\Users\Kris\Documents\Code\GitHub\plex-dvr-waker\Plex\DataAdapter.cs:line 82
   at PlexDvrWaker.Program.RunList(ListOptions options) in C:\Users\Kris\Documents\Code\GitHub\plex-dvr-waker\Program.cs:line 100
   at PlexDvrWaker.Program.Main(String[] args) in C:\Users\Kris\Documents\Code\GitHub\plex-dvr-waker\Program.cs:line 29

Desktop (please complete the following information):

kmahon37 commented 4 years ago

The problem was that your Plex database does not have any scheduled recordings, and my code wasn't handling that situation correctly.

Fixed in v1.1.0