MP2 - V2.4.1 Add version info to settings section (1 Viewer)

ge2301

Lead Design MP2
  • Team MediaPortal
  • January 11, 2014
    8,705
    3,491
    Stuttgart
    Home Country
    Germany Germany
    I tried for the client to provide a string, but fully failed I think :ROFLMAO:
    C#:
    using MediaPortal.Common;
    using MediaPortal.Common.Configuration.ConfigurationClasses;
    using MediaPortal.UI.FrontendServer;
    using MediaPortal.UI.ServerCommunication.Settings;
    
    using System;
    using System.Diagnostics;
    
    namespace MediaPortal.UiComponents.SkinBase.Settings.Configuration.General
    {
      public class Version : CustomConfigSetting
      {
        FileVersionInfo fileVersionInfo = FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetCallingAssembly().Location);
        private string _info = fileVersionInfo.FileVersion;
      }
    }
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    I am working on a different solution which should include the version information in the UPnP device detection and also database saving of attached clients on a server. By this approach we can monitor all MP2-Clients and the Server in the network and show every version in the dialog.
     

    AdHu86

    Portal Pro
    January 14, 2022
    88
    98
    Berlin
    Home Country
    England England
    I am working on a different solution which should include the version information in the UPnP device detection and also database saving of attached clients on a server. By this approach we can monitor all MP2-Clients and the Server in the network and show every version in the dialog.
    Sounds great. Perhaps you can show the structure with versions in a tree view (all clients connected to a server. Would it also detect a second server in the network?
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    I have implemented the first steps, added client version to MP2 server db (attached_clients), extended UPnP devices to add the new "<softwareVersion>2.4.xxx</softwareVersion>" XML tag and the parsers read this information. I used "softwareVersion", as I also have other devices that add this tag.

    Currently I show the version information inside MP2-Server GUI (when running with "-c" argument for console mode) and the ServiceMonitor:
    1659869450657.png

    1659869471253.png


    At the moment I think about the best way of integration in MP2-Client GUI. Probably best approach is the show all MP2-Devices found in network via UPnP. This would show also non-attached clients and other servers (which should not be done inside single network ;-))
     

    AdHu86

    Portal Pro
    January 14, 2022
    88
    98
    Berlin
    Home Country
    England England
    An we also add the IP address of clients and server? By this it’s at least easy to identify what is on the same machine. Is it at least possible to know which is the connected server in case of two servers?
    Well, best would be really a tree view of connected server with clients and everything else apart, but I’m also unsure about the best view.
     

    ge2301

    Lead Design MP2
  • Team MediaPortal
  • January 11, 2014
    8,705
    3,491
    Stuttgart
    Home Country
    Germany Germany
    At the moment I think about the best way of integration in MP2-Client GUI. Probably best approach is the show all MP2-Devices found in network via UPnP. This would show also non-attached clients and other servers (which should not be done inside single network ;-))
    Well, I've two servers and 3 clients in my network. so I'm already the first "exception" ;)
    Anyhow I also think it's best to show all devices in case we can highlight the current client and server.

    An we also add the IP address of clients and server?
    I believe the IP is already available for the client. In case there is a name probably just the name is shown "Morpheus8".
     

    ge2301

    Lead Design MP2
  • Team MediaPortal
  • January 11, 2014
    8,705
    3,491
    Stuttgart
    Home Country
    Germany Germany
    @morpheus_xx
    Once I started the server with your changes, I can not start my regular server (MP2.4.1) anymore. Of course I stopped the 2.5 server before that.
    Detailed attached.
     

    Attachments

    • Crash.log
      3 KB

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    Oh, this can be a problem. The "sub schema" for client manager get's updated to 1.1 (while regular 2.4 uses 1.0 only). So this could be a breaking change in DB model :(
    At the moment you should make backup / switch between datastore.s3db copies. I can send you a sql script to "downgrade" the DB if you like.
     

    ge2301

    Lead Design MP2
  • Team MediaPortal
  • January 11, 2014
    8,705
    3,491
    Stuttgart
    Home Country
    Germany Germany
    I can send you a sql script to "downgrade" the DB if you like.
    Yes, please. Another thing I realize is that I have no server sources with the latest changes, even the server is connected and also all fanart is missing.
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    Unfortunately sqlite does not support to drop column from a table, so the downgrade takes a few more steps:
    SQL:
    begin transaction;
    
    alter table attached_clients rename to bak_clients;
    
    CREATE TABLE ATTACHED_CLIENTS (SYSTEM_ID TEXT COLLATE NOCASE NOT NULL PRIMARY KEY,   LAST_HOSTNAME TEXT COLLATE NOCASE, LAST_CLIENT_NAME TEXT COLLATE NOCASE) WITHOUT ROWID;
    
    insert into attached_clients (system_id, last_hostname, last_client_name) select system_id, last_hostname, last_client_name from bak_clients;
    
    update mediaportal_basis set version_minor = 0 where subschema_name = 'ClientManager';
    
    drop table bak_clients;
    
    commit;

    Please first take a backup of the datastore.s3db.
     
    Last edited:

    Users who are viewing this thread

    Top Bottom