[6.0.3] Trakt for MediaPortal [2020-01-01] (5 Viewers)

Sebastiii

Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    Hey :)
    I've maybe another bug, i was trying to look at @ajs issue :

    Code:
    [2018-03-02 21:33:31,351] [Error  ] [CheckConnection] [ERROR] - MediaPortal: Unhandled exception occured
    [2018-03-02 21:33:31,371] [Log    ] [CheckConnection] [ERROR] - Exception: System.NullReferenceException: Ссылка на объект не указывает на экземпляр объекта.
       в System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
       в System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)
       в TraktPlugin.GUI.GUIUtils.ShowNotifyDialog(String heading, String text, String image, String buttonText, Int32 timeout)
       в TraktPlugin.TraktPlugin.<>c.<GUIWindowManager_OnActivateWindow>b__34_0()
       в System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       в System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       в System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       в System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       в System.Threading.ThreadHelper.ThreadStart()  Message: Ссылка на объект не указывает на экземпляр объекта.  Site   : System.Object MarshaledInvoke(System.Windows.Forms.Control, System.Delegate, System.Object[], Boolean)  Source : System.Windows.Forms  Stack Trace:     в System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
       в System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)
       в TraktPlugin.GUI.GUIUtils.ShowNotifyDialog(String heading, String text, String image, String buttonText, Int32 timeout)
       в TraktPlugin.TraktPlugin.<>c.<GUIWindowManager_OnActivateWindow>b__34_0()
       в System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       в System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       в System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       в System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       в System.Threading.ThreadHelper.ThreadStart()

    And i have run into MP crash :
    Code:
    Application: MediaPortal.exe
    Framework Version: v4.0.30319
    Description: The process was terminated due to an unhandled exception.
    Exception Info: System.IO.FileNotFoundException
    
    Server stack trace:
       at TraktAPI.Extensions.JSONExtensions.FromJSONDictionary[T](String json)
       at TraktAPI.Extensions.DateTimeExtensions.OlsenToWindowsTimezone(String olsenTimezone)
       at TraktPlugin.GUI.GUICommon.SetShowProperties(TraktShowSummary show)
       at TraktPlugin.TraktDashboard.OnTrendingShowSelected(GUIListItem item, GUIControl parent)
       at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
       at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)
       at System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(System.Runtime.Remoting.Messaging.Message, Boolean)
       at System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(System.Object, System.Runtime.Remoting.Proxies.MessageData ByRef)
       at MediaPortal.GUI.Library.GUIListItem+ItemSelectedHandler.EndInvoke(System.IAsyncResult)
       at MediaPortal.GUI.Library.GUIListItem.itemSelectedCallback(System.IAsyncResult)
       at System.Runtime.Remoting.Messaging.AsyncResult.SyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage)
       at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage, System.Runtime.Remoting.Messaging.IMessageSink)
       at System.Runtime.Remoting.Proxies.AgileAsyncWorkerItem.ThreadPoolCallBack(System.Object)
       at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(System.Object)
       at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
       at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
       at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
       at System.Threading.ThreadPoolWorkQueue.Dispatch()
       at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

    So looked the code and add a try catch here :

    C#:
    /// <summary>
            /// Returns the corresponding Olsen timezone e.g. 'Atlantic/Canary' into a Windows timezone e.g. 'GMT Standard Time'
            /// </summary>
            public static string OlsenToWindowsTimezone(this string olsenTimezone)
            {
                if (olsenTimezone == null)
                    return null;
    
                if (_timezoneMappings == null)
                {
                    try
                    {
                        _timezoneMappings = Resources.OlsenToWindows.FromJSONDictionary<Dictionary<string, string>>();
                    }
                    catch (Exception)
                    {
                        return null;
                    }
                }
    
                string windowsTimezone;
                _timezoneMappings.TryGetValue(olsenTimezone, out windowsTimezone);
    
                return windowsTimezone;
            }

    This try / catch seems to do the work :p
    I've reproduced it but starting MP with load last plugin (here Trakt) and start to navigate :p and boom :)

    upload_2018-3-3_16-44-3.png



    I have also noted a possible bull reference exception here "DateTimeFormatInfo.CurrentInfo' (just after above code) for :p

    C#:
    public static string ToLocalisedDayOfWeek(this DateTime date)
            {
                return DateTimeFormatInfo.CurrentInfo.GetDayName(date.DayOfWeek);
            }
     

    ltfearme

    Community Plugin Dev
  • Premium Supporter
  • June 10, 2007
    6,755
    7,200
    Sydney
    Home Country
    Australia Australia
    I don't understand how you get that exception @Sebastiii , but I have added the exception handling. It's like it failed to load the resource I think but im unsure.

    Regarding the possible null reference exception in ToLocalisedDayOfWeek, I don't think it's possible for _DateTimeFormatInfo.CurrentInfo_ to be null? I can tighten it up anyway.

    I can't comment on ajs' crash, im not sure how that happen.
     
    Last edited:

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    Thanks :)
    Yep not sure too but it was happening when he has no internet connection on his PC (provider issue) then MP start slowly and lead to the crash and not sure why exactly :(
     

    ltfearme

    Community Plugin Dev
  • Premium Supporter
  • June 10, 2007
    6,755
    7,200
    Sydney
    Home Country
    Australia Australia

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    16,059
    11,141
    Kyiv
    Home Country
    Ukraine Ukraine

    ltfearme

    Community Plugin Dev
  • Premium Supporter
  • June 10, 2007
    6,755
    7,200
    Sydney
    Home Country
    Australia Australia
    I dont see any settings about UserRating ...but I'll look again ...

    --
    WBR, ajs :):whistle::coffee:
    You already have it enabled, I saw from one of your logs:
    2018-03-04 17:14:14.844 [INFO] [Sync][06]: My Videos Starting Library Sync
    2018-03-04 17:14:15.014 [INFO] [Sync][06]: There are 0 unwatched movies since the last sync with trakt.tv
    2018-03-04 17:14:15.016 [INFO] [Sync][06]: Getting current user watched movies from trakt
    2018-03-04 17:14:15.019 [INFO] [Sync][06]: There are 2532 watched movies in trakt.tv library
    2018-03-04 17:14:15.022 [INFO] [Sync][06]: Getting current user collected movies from trakt
    2018-03-04 17:14:15.025 [INFO] [Sync][06]: There are 992 collected movies in trakt.tv library
    2018-03-04 17:14:15.028 [INFO] [Sync][06]: Getting current user rated movies from trakt
    2018-03-04 17:14:15.031 [INFO] [Sync][06]: There are 2287 rated movies in trakt.tv library
    2018-03-04 17:14:15.051 [INFO] [Sync][06]: Found 17 movies available to sync in My Videos database
    2018-03-04 17:14:15.054 [INFO] [Sync][06]: Found 15 watched movies available to sync in My Videos database
    2018-03-04 17:14:15.057 [INFO] [Sync][06]: Found 15 rated movies available to sync in My Videos database
    2018-03-04 17:14:15.250 [INFO] [Sync][06]: Finding movies to add to trakt.tv watched history
    2018-03-04 17:14:15.264 [INFO] [Sync][06]: Adding 0 movies to trakt.tv watched history
    2018-03-04 17:14:15.268 [INFO] [Sync][06]: Finding movies to add to trakt.tv collection
    2018-03-04 17:14:15.277 [INFO] [Sync][06]: Adding 0 movies to trakt.tv collection
    2018-03-04 17:14:15.280 [INFO] [Sync][06]: Finding movies to add to trakt.tv ratings
    2018-03-04 17:14:15.286 [INFO] [Sync][06]: Adding 0 movies to trakt.tv ratings

    2018-03-04 17:14:15.291 [INFO] [Sync][06]: My Videos Library Sync Completed
     

    Users who are viewing this thread

    Top Bottom