Ombi-app / Ombi

Want a Movie or TV Show on Plex/Emby/Jellyfin? Use Ombi!
http://ombi.io
GNU General Public License v2.0
3.71k stars 395 forks source link

Newsletter not listing new episodes added for existing shows #1264

Closed Stryk3r78 closed 7 years ago

Stryk3r78 commented 7 years ago

Ombi Version: 2.1.1538

Update Branch: Early Access Preview

Media Sever: Plex

Media Server Version: 1.4.3.3433

Operating System: Windows 10

Problem Description: Since the recent changes to the newsletter the new tv episodes section is now not listing any new episodes added from existing shows, but is only listing new episodes for shows that were newly added. Since new tv shows are not added regularly, it would really be nice if it could have all new eps for new and existing shows listed that were recently added. It used to do this fine before the recent changes.

Reproduction Steps: Sending a test newsletter after adding a new episode for an existing show will not include the episode in the newsletter list. But if I add a new show, then add new episodes, those will show up in the newsletter.

Stryk3r78 commented 7 years ago

I updated to the EAP version 1607 and seems this may be fixed now. I manually ran the episode cacher, and now it actually seems to run on demand. It took about a minute or so to run (before it just "Succeeded" instantly) and now my Plex Episodes table has content! But sending a test newsletter was still only showing my movies.

So I stopped OMBI and opened my recentlyaddedlog table in SQL browser and deleted all the entries listed that didn't start with tt (ie not movies) as there was a couple hundred of them and I'm assuming these were all my shows in my library. Then I restarted OMBI, manually ran the plex cacher and episode cacher, and resent the newsletter. It took MUCH longer this time (about 5 mins as I think it was actually processing all the data finally) and it sent the newsletter with new episodes finally! Only problem was it looks like it sent everything in my library as being new even old stuff that's been there forever. I think it had marked all my tv shows in the recentlyaddedlog table so it was ignoring them but now I removed the entries from the table it's listing everything as new. This at least hopefully means the next time it runs it will only add the new stuff.

So I manually ran the Recently added email notification job and it seems to have sent the newsletter with all the tv shows. I can also confirm that my recentlyaddedlog table is FULL of entries from today. Running a new test newsletter is still showing a few tv shows with no episodes listed but the list is only 4 items vs all the items it was listing after I modify the recently added table. There's also a few movies listed as well, not sure why they weren't marked as "not new" when the newsletter send. But I will see tonight if the episodes that download today appear in tomorrow's test newsletter.

Stryk3r78 commented 7 years ago

I also finally have some errors in the logs. Maybe this relates to the few shows that didn't purge from the newsletter after I modified the recentlyaddedlog table.

System.NullReferenceException: Object reference not set to an instance of an object. at Ombi.Services.Jobs.RecentlyAddedNewsletter.PlexRecentlyAddedNewsletter.GenerateTvHtml(IEnumerable1 recenetlyAddedTv, StringBuilder sb) in C:\projects\requestplex\Ombi.Services\Jobs\RecentlyAddedNewsletter\PlexRecentlyAddedNewsletter.cs:line 334 Ombi.Services.Jobs.RecentlyAddedNewsletter.PlexRecentlyAddedNewsletter Error 4/4/2017 4:20:56 PM System.NullReferenceException: Object reference not set to an instance of an object. at Ombi.Api.TvMazeApi.ShowLookupByTheTvDbId(Int32 theTvDbId) in C:\projects\requestplex\Ombi.Api\TvMazeApi.cs:line 87 Ombi.Api.TvMazeApi Error 4/4/2017 4:20:56 PM System.NullReferenceException: Object reference not set to an instance of an object. at Ombi.Services.Jobs.RecentlyAddedNewsletter.PlexRecentlyAddedNewsletter.GenerateTvHtml(IEnumerable1 recenetlyAddedTv, StringBuilder sb) in C:\projects\requestplex\Ombi.Services\Jobs\RecentlyAddedNewsletter\PlexRecentlyAddedNewsletter.cs:line 334 Ombi.Services.Jobs.RecentlyAddedNewsletter.PlexRecentlyAddedNewsletter Error 4/4/2017 4:20:56 PM Newtonsoft.Json.JsonSerializationException: Error converting value {null} to type 'System.Double'. Path 'runtime', line 1, position 181. ---> System.InvalidCastException: Null object cannot be converted to a value type. at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType) --- End of inner exception stack trace --- at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings) at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings) at Ombi.Api.TvMazeApi.ShowLookupByTheTvDbId(Int32 theTvDbId) in C:\projects\requestplex\Ombi.Api\TvMazeApi.cs:line 87 Ombi.Api.TvMazeApi Error 4/4/2017 4:20:56 PM

JDIacobbo commented 7 years ago

So I stopped OMBI and opened my recentlyaddedlog table in SQL browser and deleted all the entries listed that didn't start with tt (ie not movies) as there was a couple hundred of them and I'm assuming these were all my shows in my library. Then I restarted OMBI, manually ran the plex cacher and episode cacher, and resent the newsletter. It took MUCH longer this time (about 5 mins as I think it was actually processing all the data finally) and it sent the newsletter with new episodes finally! Only problem was it looks like it sent everything in my library as being new even old stuff that's been there forever. I think it had marked all my tv shows in the recentlyaddedlog table so it was ignoring them but now I removed the entries from the table it's listing everything as new. This at least hopefully means the next time it runs it will only add the new stuff

I did this same thing and thought it might work. But after clearing out the table, the next email sent out was blank, and the following email only grabbed recently added movies.

elit3ge commented 7 years ago

Ok, so latest EAP with episode searching on. Started an episode cache run and my logs are filling up with this, over and over cause my Ombi to crash and become unresponsive. I have to restart it every 15 mins with ep searching on, with it off not an issue.

System.InvalidOperationException: There is an error in XML document (0, 0). ---> System.Xml.XmlException: Root element is missing. at System.Xml.XmlTextReaderImpl.Throw (System.Exception e) [0x0002a] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo (System.String res) [0x00017] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlTextReaderImpl.ParseDocumentContent () [0x0041e] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlTextReaderImpl.Read () [0x00097] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlTextReader.Read () [0x00000] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlReader.MoveToContent () [0x0004b] in <1140eab9e72948548294172a9716416d>:0 at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderPlexEpisodeMetadata.Read11_MediaContainer () [0x00008] in <9e2adf50005347d8a1cd9a351c15e59e>:0 at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in <8f2c484307284b51944a1a13a14c0266>:0 --- End of inner exception stack trace --- at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.XmlReader xmlReader, System.String encodingStyle, System.Xml.Serialization.XmlDeserializationEvents events) [0x00139] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.XmlReader xmlReader, System.String encodingStyle) [0x00000] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.Serialization.XmlSerializer.Deserialize (System.IO.TextReader textReader) [0x0001c] in <1140eab9e72948548294172a9716416d>:0 at Ombi.Api.ApiRequest.DeserializeXml[T] (System.String input) [0x00017] in :0  Ombi.Api.ApiRequest Error   4/5/2017 7:59:33 AM
System.InvalidOperationException: There is an error in XML document (0, 0). ---> System.Xml.XmlException: Root element is missing. at System.Xml.XmlTextReaderImpl.Throw (System.Exception e) [0x0002a] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo (System.String res) [0x00017] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlTextReaderImpl.ParseDocumentContent () [0x0041e] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlTextReaderImpl.Read () [0x00097] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlTextReader.Read () [0x00000] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlReader.MoveToContent () [0x0004b] in <1140eab9e72948548294172a9716416d>:0 at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderPlexEpisodeMetadata.Read11_MediaContainer () [0x00008] in <9e2adf50005347d8a1cd9a351c15e59e>:0 at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in <8f2c484307284b51944a1a13a14c0266>:0 --- End of inner exception stack trace --- at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.XmlReader xmlReader, System.String encodingStyle, System.Xml.Serialization.XmlDeserializationEvents events) [0x00139] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.XmlReader xmlReader, System.String encodingStyle) [0x00000] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.Serialization.XmlSerializer.Deserialize (System.IO.TextReader textReader) [0x0001c] in <1140eab9e72948548294172a9716416d>:0 at Ombi.Api.ApiRequest.DeserializeXml[T] (System.String input) [0x00017] in :0  Ombi.Api.ApiRequest Error   4/5/2017 7:59:32 AM
System.InvalidOperationException: There is an error in XML document (0, 0). ---> System.Xml.XmlException: Root element is missing. at System.Xml.XmlTextReaderImpl.Throw (System.Exception e) [0x0002a] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo (System.String res) [0x00017] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlTextReaderImpl.ParseDocumentContent () [0x0041e] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlTextReaderImpl.Read () [0x00097] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlTextReader.Read () [0x00000] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlReader.MoveToContent () [0x0004b] in <1140eab9e72948548294172a9716416d>:0 at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderPlexEpisodeMetadata.Read11_MediaContainer () [0x00008] in <9e2adf50005347d8a1cd9a351c15e59e>:0 at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in <8f2c484307284b51944a1a13a14c0266>:0 --- End of inner exception stack trace --- at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.XmlReader xmlReader, System.String encodingStyle, System.Xml.Serialization.XmlDeserializationEvents events) [0x00139] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.XmlReader xmlReader, System.String encodingStyle) [0x00000] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.Serialization.XmlSerializer.Deserialize (System.IO.TextReader textReader) [0x0001c] in <1140eab9e72948548294172a9716416d>:0 at Ombi.Api.ApiRequest.DeserializeXml[T] (System.String input) [0x00017] in :0  Ombi.Api.ApiRequest Error   4/5/2017 7:59:32 AM
System.InvalidOperationException: There is an error in XML document (0, 0). ---> System.Xml.XmlException: Root element is missing. at System.Xml.XmlTextReaderImpl.Throw (System.Exception e) [0x0002a] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo (System.String res) [0x00017] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlTextReaderImpl.ParseDocumentContent () [0x0041e] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlTextReaderImpl.Read () [0x00097] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlTextReader.Read () [0x00000] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlReader.MoveToContent () [0x0004b] in <1140eab9e72948548294172a9716416d>:0 at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderPlexEpisodeMetadata.Read11_MediaContainer () [0x00008] in <9e2adf50005347d8a1cd9a351c15e59e>:0 at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in <8f2c484307284b51944a1a13a14c0266>:0 --- End of inner exception stack trace --- at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.XmlReader xmlReader, System.String encodingStyle, System.Xml.Serialization.XmlDeserializationEvents events) [0x00139] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.XmlReader xmlReader, System.String encodingStyle) [0x00000] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.Serialization.XmlSerializer.Deserialize (System.IO.TextReader textReader) [0x0001c] in <1140eab9e72948548294172a9716416d>:0 at Ombi.Api.ApiRequest.DeserializeXml[T] (System.String input) [0x00017] in :0  Ombi.Api.ApiRequest Error   4/5/2017 7:59:31 AM
System.InvalidOperationException: There is an error in XML document (0, 0). ---> System.Xml.XmlException: Root element is missing. at System.Xml.XmlTextReaderImpl.Throw (System.Exception e) [0x0002a] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo (System.String res) [0x00017] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlTextReaderImpl.ParseDocumentContent () [0x0041e] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlTextReaderImpl.Read () [0x00097] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlTextReader.Read () [0x00000] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlReader.MoveToContent () [0x0004b] in <1140eab9e72948548294172a9716416d>:0 at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderPlexEpisodeMetadata.Read11_MediaContainer () [0x00008] in <9e2adf50005347d8a1cd9a351c15e59e>:0 at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in <8f2c484307284b51944a1a13a14c0266>:0 --- End of inner exception stack trace --- at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.XmlReader xmlReader, System.String encodingStyle, System.Xml.Serialization.XmlDeserializationEvents events) [0x00139] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.XmlReader xmlReader, System.String encodingStyle) [0x00000] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.Serialization.XmlSerializer.Deserialize (System.IO.TextReader textReader) [0x0001c] in <1140eab9e72948548294172a9716416d>:0 at Ombi.Api.ApiRequest.DeserializeXml[T] (System.String input) [0x00017] in :0  Ombi.Api.ApiRequest Error   4/5/2017 7:59:31 AM
System.InvalidOperationException: There is an error in XML document (0, 0). ---> System.Xml.XmlException: Root element is missing. at System.Xml.XmlTextReaderImpl.Throw (System.Exception e) [0x0002a] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo (System.String res) [0x00017] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlTextReaderImpl.ParseDocumentContent () [0x0041e] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlTextReaderImpl.Read () [0x00097] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlTextReader.Read () [0x00000] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlReader.MoveToContent () [0x0004b] in <1140eab9e72948548294172a9716416d>:0 at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderPlexEpisodeMetadata.Read11_MediaContainer () [0x00008] in <9e2adf50005347d8a1cd9a351c15e59e>:0 at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in <8f2c484307284b51944a1a13a14c0266>:0 --- End of inner exception stack trace --- at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.XmlReader xmlReader, System.String encodingStyle, System.Xml.Serialization.XmlDeserializationEvents events) [0x00139] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.XmlReader xmlReader, System.String encodingStyle) [0x00000] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.Serialization.XmlSerializer.Deserialize (System.IO.TextReader textReader) [0x0001c] in <1140eab9e72948548294172a9716416d>:0 at Ombi.Api.ApiRequest.DeserializeXml[T] (System.String input) [0x00017] in :0  Ombi.Api.ApiRequest Error   4/5/2017 7:59:31 AM
System.InvalidOperationException: There is an error in XML document (0, 0). ---> System.Xml.XmlException: Root element is missing. at System.Xml.XmlTextReaderImpl.Throw (System.Exception e) [0x0002a] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo (System.String res) [0x00017] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlTextReaderImpl.ParseDocumentContent () [0x0041e] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlTextReaderImpl.Read () [0x00097] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlTextReader.Read () [0x00000] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlReader.MoveToContent () [0x0004b] in <1140eab9e72948548294172a9716416d>:0 at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderPlexEpisodeMetadata.Read11_MediaContainer () [0x00008] in <9e2adf50005347d8a1cd9a351c15e59e>:0 at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in <8f2c484307284b51944a1a13a14c0266>:0 --- End of inner exception stack trace --- at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.XmlReader xmlReader, System.String encodingStyle, System.Xml.Serialization.XmlDeserializationEvents events) [0x00139] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.XmlReader xmlReader, System.String encodingStyle) [0x00000] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.Serialization.XmlSerializer.Deserialize (System.IO.TextReader textReader) [0x0001c] in <1140eab9e72948548294172a9716416d>:0 at Ombi.Api.ApiRequest.DeserializeXml[T] (System.String input) [0x00017] in :0  Ombi.Api.ApiRequest Error   4/5/2017 7:59:31 AM
System.InvalidOperationException: There is an error in XML document (0, 0). ---> System.Xml.XmlException: Root element is missing. at System.Xml.XmlTextReaderImpl.Throw (System.Exception e) [0x0002a] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo (System.String res) [0x00017] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlTextReaderImpl.ParseDocumentContent () [0x0041e] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlTextReaderImpl.Read () [0x00097] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlTextReader.Read () [0x00000] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlReader.MoveToContent () [0x0004b] in <1140eab9e72948548294172a9716416d>:0 at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderPlexEpisodeMetadata.Read11_MediaContainer () [0x00008] in <9e2adf50005347d8a1cd9a351c15e59e>:0 at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in <8f2c484307284b51944a1a13a14c0266>:0 --- End of inner exception stack trace --- at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.XmlReader xmlReader, System.String encodingStyle, System.Xml.Serialization.XmlDeserializationEvents events) [0x00139] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.XmlReader xmlReader, System.String encodingStyle) [0x00000] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.Serialization.XmlSerializer.Deserialize (System.IO.TextReader textReader) [0x0001c] in <1140eab9e72948548294172a9716416d>:0 at Ombi.Api.ApiRequest.DeserializeXml[T] (System.String input) [0x00017] in :0  Ombi.Api.ApiRequest Error   4/5/2017 7:59:30 AM
System.InvalidOperationException: There is an error in XML document (0, 0). ---> System.Xml.XmlException: Root element is missing. at System.Xml.XmlTextReaderImpl.Throw (System.Exception e) [0x0002a] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo (System.String res) [0x00017] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlTextReaderImpl.ParseDocumentContent () [0x0041e] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlTextReaderImpl.Read () [0x00097] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlTextReader.Read () [0x00000] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlReader.MoveToContent () [0x0004b] in <1140eab9e72948548294172a9716416d>:0 at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderPlexEpisodeMetadata.Read11_MediaContainer () [0x00008] in <9e2adf50005347d8a1cd9a351c15e59e>:0 at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in <8f2c484307284b51944a1a13a14c0266>:0 --- End of inner exception stack trace --- at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.XmlReader xmlReader, System.String encodingStyle, System.Xml.Serialization.XmlDeserializationEvents events) [0x00139] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.XmlReader xmlReader, System.String encodingStyle) [0x00000] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.Serialization.XmlSerializer.Deserialize (System.IO.TextReader textReader) [0x0001c] in <1140eab9e72948548294172a9716416d>:0 at Ombi.Api.ApiRequest.DeserializeXml[T] (System.String input) [0x00017] in :0  Ombi.Api.ApiRequest Error   4/5/2017 7:59:30 AM
System.InvalidOperationException: There is an error in XML document (0, 0). ---> System.Xml.XmlException: Root element is missing. at System.Xml.XmlTextReaderImpl.Throw (System.Exception e) [0x0002a] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo (System.String res) [0x00017] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlTextReaderImpl.ParseDocumentContent () [0x0041e] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlTextReaderImpl.Read () [0x00097] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlTextReader.Read () [0x00000] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlReader.MoveToContent () [0x0004b] in <1140eab9e72948548294172a9716416d>:0 at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderPlexEpisodeMetadata.Read11_MediaContainer () [0x00008] in <9e2adf50005347d8a1cd9a351c15e59e>:0 at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in <8f2c484307284b51944a1a13a14c0266>:0 --- End of inner exception stack trace --- at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.XmlReader xmlReader, System.String encodingStyle, System.Xml.Serialization.XmlDeserializationEvents events) [0x00139] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.XmlReader xmlReader, System.String encodingStyle) [0x00000] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.Serialization.XmlSerializer.Deserialize (System.IO.TextReader textReader) [0x0001c] in <1140eab9e72948548294172a9716416d>:0 at Ombi.Api.ApiRequest.DeserializeXml[T] (System.String input) [0x00017] in :0  Ombi.Api.ApiRequest Error   4/5/2017 7:59:30 AM
GilbN commented 7 years ago

@elit3ge looks like the same error #1308

elit3ge commented 7 years ago

@gilbN Except you were trying to send a test newsletter, mine is just trying to scan and then dies.

ofurpesi commented 7 years ago

Ran the Plex episode cacher. After it finished, i sent a test email to myself. It displayed movies that i added a long time ago and some episodes i added a long time ago as well. Nothing new displayed even though i had new episodes...

Stryk3r78 commented 7 years ago

Yea still not working. NO new eps added from last nights downloads. I also have the same error as @elit3ge in my logs this morning

System.InvalidOperationException: There is an error in XML document (0, 0). ---> System.Xml.XmlException: Root element is missing. at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.ParseDocumentContent() at System.Xml.XmlTextReaderImpl.Read() at System.Xml.XmlTextReader.Read() at System.Xml.XmlReader.MoveToContent() at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderPlexAccount.Read3_user() --- End of inner exception stack trace --- at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events) at System.Xml.Serialization.XmlSerializer.Deserialize(TextReader textReader) at Ombi.Api.ApiRequest.DeserializeXml[T](String input) in C:\projects\requestplex\Ombi.Api\ApiRequest.cs:line 107 Ombi.Api.ApiRequest Error 4/5/2017 2:31:41 AM

But the issues with my blank table at least is resolved but the episode parsing is still not working right.

GilbN commented 7 years ago

Same here, not working. But no errors in the log

Stryk3r78 commented 7 years ago

Something else interesting that seems to have happened. My test newsletter is sending different results from the "recently added email notification" job. Since I manually cleared by recentlyaddedlog table I have some old random movies and tv shows showing up in the test newsletter when I send it now. But I just manually ran the recently added email job and it sent the newsletter which showed the 3 new movies and 2 new shows I added today but of course none of the new episodes for my existing shows were listed still.

I then ran the test newsletter again and technically it should be blank now that it should have updated the recentlyaddedlog table but it sent the same list of random movies and tv shows from before. So I'm getting 2 completely different newsletters depending on whether I run a test newsletter or the newsletter job. There were no errors in the log after running any of these jobs or test newsletters, the last error I had was the one posted above from 2:31am last night with the XML errors.

ofurpesi commented 7 years ago

My setup is behaving almost exactly like yours @Stryk3r78

Stryk3r78 commented 7 years ago

I had another look at the contents of my test newsletter, and it seems that what it's sending at the first 5 movies and tv shows (with no episodes listed underneath, just the show description) from my library in alphabetical order.

my 5 movies are: 10 things about you, 2017 oscar short films, 20th century women, the accountant, and alice through the looking glass. then my 5 tv shows are: the 100, 1000 ways to die, 24: legacy, adam ruins everything and the affair.

These items keep being sent in the test newsletter regardless of what new is added to my library, and all of these items have been in my library for a while and have not appeared in any recently added list likely until I cleared my recentlyaddedlog table.

At least there is some pattern to what's showing up, and if I send the actual newsletter manually using the job, none of these show up and I get the proper results (minus new eps for existing shows). Again no errors at all in my logs from last night, lots of new episodes added and even a couple movies but the contents of the test newsletter now don't change anymore, just what's listed above the same "first 5" items from both my libraries.

tidusjar commented 7 years ago

Just to update everyone, I've just found a massive flaw in the way we try and find new episodes that I am fixing now. I am working on this even know i've not posted on here recently.

GilbN commented 7 years ago

Excellent news!

tidusjar commented 7 years ago

So guys,

Can you try EAP?

I've bumped up the version number to 2.2.1 and added a new migrations task that will clear out your RecentlyAddedLog table and re-populate it with the correct information.

The issue with episodes was that to find 'unique' episodes I was looking the the main provider id e.g. IMDBId/TheMovieDb.

So each episode has a "ProviderId" which is the series IMDBId. So I was looking for episodes that I have sent using the IMDBId meaning if 1 episode has been sent for that series then it would not send anymore (Since all episodes have the same provider id).

That was the issue, to resolve this, internally Plex stores it's own unique Id for episodes, I am now using that instead.

I also fixed the issue where in the email it shows the comma at the end of the episode: image

It's only a small thing but I fixed that: image

Stryk3r78 commented 7 years ago

Thanks Jamie,

I've updated to 2.2.1643 and it appears that the new episodes are being listed now. I re ran the episode cacher and plex cacher jobs and send a test newsletter and the TV section is now showing what matches to my recently added section in plex from today. However, my Movie section is still showing the "first 5" items from my movie library like I mentioned above, but the tv section sorted itself out.

One other thing I noticed and maybe it's just nitpicking, but display order in the newsletter doesn't match the order in which they were added (I had noticed this as well for the movies, something I had downloaded Monday might be listed first and then something downloaded Thursday night which would be the most recent item would be listed last). Not sure if there is a way to order by time added or if you even care.

Do you know how I might be able to resolve the issue with my test newsletter movie section? I'm not sure how it got like this and the "newsletter job" doesn't seem to send these 5 movies in its list but I know there are movies I downloaded today, that aren't showing up in the test now.

tidusjar commented 7 years ago

Excellent news!

So for test emails (I did add this into the tooltip). If we cannot find any 'new' content, for test purposes we will grab 5 items. In your case there are no movies, so for the test email we just grab the first 5 movies in the Ombi database for display purposes.

Otherwise you could press "test" and not have any new content and the email wouldn't even send.

Regarding the order, we do record the date and time it was added into the Ombi database so it is possible to order them. Newest first or oldest first?

GilbN commented 7 years ago

@tidusjar Updated to 2.2.1646. TvShows are working now. But movies not so much. It's showing the first movies in my first plex library :S

Edit: Yeah I saw :) I have added about 20 new movies this week though. But I guess new movies from now on will be added.

tidusjar commented 7 years ago

@gilbN Look at my above comment

Stryk3r78 commented 7 years ago

That explains it Jamie for my movies test issue, when I sent the recently added job manually it actually sent the right results. the only issue is that I know there is at least 2 new movies I added today.... but maybe it will work itself out tomorrow morning when the newsletter fires off from cron. I'll just let it do it's thing and let you know tomorrow if it doesn't update properly.

As far as ordering, personally I think it would be best to have both Movies and TV shows with the "Most Recent" at the top of the section. So that when users read it, they are looking at the most recent items first ( I find my users like to know what newest first).

Thanks so much for you help!

tidusjar commented 7 years ago

I pushed a new commit into eap. I am now ordered them, the problem is for the Plex content I wasn't stamping the time I was adding them. So for new content going forward it will order them correctly :) (Date Descending)

GilbN commented 7 years ago

Hm, the test newsletter is showing the same movies as on 2.2.1646. but tvshows is not showing anything new but older shows that I haven't added anything on for a long time. So I guess the same is happening now on tvshows as with movies because nothing is new since last time I ran the test newsletter? So all good I guess? :D

tidusjar commented 7 years ago

So yes!

If there is nothing new then we just grab random data for the test purpose.

tidusjar commented 7 years ago

If you want to test this you can do the following:

Open up the db and look at the PlexEpisodes table.

Find an episode that you want to appear in the newsletter and take note of the RatingKey

Execute the following Query:

Delete From RecentlyAddedLog where ProviderId='YourRatingKey'

Same with the PlexContent but take note of the ProviderId and then:

Delete From RecentlyAddedLog where ProviderId='YourProviderId'

That will tell Ombi that is hasn't marked what you deleted as "Sent" yet and will find it to resend it,

GilbN commented 7 years ago

@tidusjar worked great :)

tidusjar commented 7 years ago

I'm going to close this for now since it seems like i've fixed it. Please comment on here if you find any more issues.

Shiroihige commented 7 years ago

Is it supposed to show the episode numbers that were added in the newsletter after updating to the latest eap? Because for me it doesn't show them when I send the test email to admin.

Edit: I manually ran the episode cacher (not sure why I didn't try that beforehand) and it looks like it is populating the plexepisodes table, so seems like my issue was nonexistent

elit3ge commented 7 years ago

I still have this lovely error flooding my logs and killing the process.

System.InvalidOperationException: There is an error in XML document (0, 0). ---> System.Xml.XmlException: Root element is missing. at System.Xml.XmlTextReaderImpl.Throw (System.Exception e) [0x0002a] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo (System.String res) [0x00017] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlTextReaderImpl.ParseDocumentContent () [0x0041e] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlTextReaderImpl.Read () [0x00097] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlTextReader.Read () [0x00000] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.XmlReader.MoveToContent () [0x0004b] in <1140eab9e72948548294172a9716416d>:0 at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderPlexEpisodeMetadata.Read11_MediaContainer () [0x00008] in :0 at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in <8f2c484307284b51944a1a13a14c0266>:0 --- End of inner exception stack trace --- at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.XmlReader xmlReader, System.String encodingStyle, System.Xml.Serialization.XmlDeserializationEvents events) [0x00139] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.XmlReader xmlReader, System.String encodingStyle) [0x00000] in <1140eab9e72948548294172a9716416d>:0 at System.Xml.Serialization.XmlSerializer.Deserialize (System.IO.TextReader textReader) [0x0001c] in <1140eab9e72948548294172a9716416d>:0 at Ombi.Api.ApiRequest.DeserializeXml[T] (System.String input) [0x00017] in <7f5d015a584b4b3f89e9b62f39461ff2>:0  Ombi.Api.ApiRequest Error   4/7/2017 6:37:21 AM

Only happens with episode searching enabled.

GilbN commented 7 years ago

The newsletter that got sent out today only showed the TV show that I deleted the ratingkey on.

tidusjar commented 7 years ago

@gilbN was anything new added and the jobs run after they were added? @elit3ge that is nothing to do with the newsletter. It's an error in your episode cacher. If it's killing the process i suggest you turn off episode searching. It's quite an involved process due to the way we are working with the Plex API.

elit3ge commented 7 years ago

@tidusjar It doesn't kill the process it becomes unresponsive via the web interface. I have opened a new ticket. https://github.com/tidusjar/Ombi/issues/1356

Stryk3r78 commented 7 years ago

My newsletter that went out this morning, only showed 3 movies I downloaded last night (though they were in order this time :) )

Is it possible that the test newsletter updated the recently added log table and that's why my real newsletter is now not listed the episodes that were listed in the test newsletter I sent myself last night?

Stryk3r78 commented 7 years ago

another update, yesterday when I sent the test newsletter I had items in it. But they didn't show up in todays newsletter. New shows downloaded overnight and I noticed that they didn't showup either as teh cacher job didn't run again since I manually ran it last night (I guess it hasn't been 11 hours). After running the episode cacher manually, my test emails are now showing the items since the last test newsletter.

I reran the newsletter email job manually, and another newsletter was sent out that has the same content as the test newsletter. But it is not in order, again the most recent item is listed last, the 3rd more recent item is listed first, the 2nd oldest item is listed 2nd. I'm not sure where all the items from last nights test went, as they are completely missing even though there were there and I only sent a test, not the real newsletter.

The movies were blank as expected due to them being listed in the first newsletter this morning. So it looks like maybe it just need a cycle to "catchup". But it also brings another issue, would it be possible to run the episode cacher before sending the newsletter? I obviously had a lot of content waiting that wasn't added since the job doesn't run very often. And it doesn't seem the ordering is working for the TV shows like it was for the movies.

ofurpesi commented 7 years ago

Ran the test email. It showed movies added and a single episode, but it was missing 3 tv shows added yesterday. So still having issues with tv shows added recently

Stryk3r78 commented 7 years ago

@ofurpesi did you manually run the episode cacher before sending the test? it's possible it just needs to update. that's what happened to me this morning.

ofurpesi commented 7 years ago

@Stryk3r78 no did not run the episode cacher. Gonna do that now

ofurpesi commented 7 years ago

Ran the episode cacher...sama result. Still missing some episodes

JDIacobbo commented 7 years ago

I manually refreshed the Plex Episode Catcher, Plex Catcher, and Radarr Catcher then sent the test email. Everything is looking good so far. We will see next week when the scheduled email is sent out that everything is 100% working.

ofurpesi commented 7 years ago

Manually refreshed plex episode cacher ,Plex catcher and Radarr catcher. Same result

brooklyn11218 commented 7 years ago

I have my newsletter sent daily. The first newsletter after I manually refreshed the Plex Episode cacher had pretty much every episode of every tv show in my library. After that no tv episodes have been shown at all. Only movies.

JDIacobbo commented 7 years ago

I am having an issue now where there aren't any episodes listed unless I manually run the Plex Episode Catcher. Once I run that, the newsletter tests out fine. This seems like an issue with the Scheduled Job. Should I open a new issue for this?

brooklyn11218 commented 7 years ago

Yes. This one is closed for some reason so it would probably be better to open a new issue.