Flag Mover: backup and restore watched flags

Discussion in 'Plugin Development' started by aspik, September 23, 2018.

  1. aspik
    • Team MediaPortal

    aspik Development Group

    Joined:
    April 14, 2008
    Messages:
    1,317
    Likes Received:
    360
    Ratings:
    +587 / 1
    Hi all,

    as you probably read in the 2.2 Pre-release news, there will be a plugin to transfer watched flags. This mini plugin has basically two functions:
    - save watched series episodes and movies infos in two JSON files.
    - restore watched flags to MP2, by reading those JSON files.

    Example of watched episodes file:
    episodes (open)

    Code (XML):
    1. [
    2.    {
    3.       "show_imdb":null,
    4.       "show_tvdb":262980,
    5.       "show_title":"House of Cards (US)",
    6.       "season":1,
    7.       "number":3
    8.    },
    9.    {
    10.       "show_imdb":null,
    11.       "show_tvdb":262980,
    12.       "show_title":"House of Cards (US)",
    13.       "season":1,
    14.       "number":4
    15.    },
    16.    {
    17.       "show_imdb":null,
    18.       "show_tvdb":317653,
    19.       "show_title":"Jean-Claude Van Johnson",
    20.       "season":1,
    21.       "number":2
    22.    },
    23.    {
    24.       "show_imdb":null,
    25.       "show_tvdb":317653,
    26.       "show_title":"Jean-Claude Van Johnson",
    27.       "season":1,
    28.       "number":3
    29.    }
    30. ]

    Example of watched movies file:
    movies (open)

    Code (XML):
    1. [
    2.    {
    3.       "imdb":"tt1490017",
    4.       "tmdb":null,
    5.       "title":"The Lego Movie",
    6.       "year":2014
    7.    },
    8.    {
    9.       "imdb":"tt0050083",
    10.       "tmdb":null,
    11.       "title":"12 Angry Men",
    12.       "year":1957
    13.    },
    14.    {
    15.       "imdb":"tt0298203",
    16.       "tmdb":null,
    17.       "title":"8 Mile",
    18.       "year":2002
    19.    }
    20. ]


    Currently the files are saved into C:\ProgramData\Team MediaPortal\MP2-Client\FlagMover\[user_id]\. The restore option also expects its in this directory.
    With this, the backup and restore operations are a bit limited, so I'm currently adding an option that the user will be able to choose the backup and restore directory.



    @Lehmden
    You had issues with the last version, could you please test this one a report, if they are now solved?

    Install procedure:
    extract the content of the attached archive into c:\Program Files (x86)\Team MediaPortal\MP2-Client\Plugins\,

    After that, start MP2 client and go to settings -> plugins, where you should see a new entry "Flag Mover".

    EDIT:
    attached two versions: one for MP2.1.3 and one for MP2.2.
     

    Attached Files:

    Last edited: October 7, 2018
    • Like Like x 1
    • Thank You! Thank You! x 1
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. JSchuricht
    • Premium Supporter

    JSchuricht MP Donator

    Joined:
    January 13, 2009
    Messages:
    153
    Likes Received:
    12
    Gender:
    Male
    Occupation:
    Chemical Mechanical Planarization
    Location:
    Arizona
    Ratings:
    +23 / 0
    Home Country:
    United States of America United States of America
    Show System Specs
    Does flag mover work in 2.1 so the flags can be exported and reimported into 2.2? Flags not transferring to the new version made me roll back the upgrade.
     
  4. ge2301
    • Team MediaPortal

    ge2301 MP2 Design

    Joined:
    January 11, 2014
    Messages:
    6,163
    Likes Received:
    1,554
    Gender:
    Male
    Occupation:
    Automotive Industry
    Location:
    Stuttgart (But living abroad)
    Ratings:
    +2,339 / 2
    Home Country:
    Germany Germany
    No, flag mover workes only with MP2.2 as far as I know. When you update to MP2.2 your data base including flags is migrated on first server start after installation.
    If this didn't work for you and you didn't report it yet, please create a bug report with log files.
     
    • Agree Agree x 1
  5. Lehmden
    • Premium Supporter

    Lehmden Retired Team Member

    Joined:
    December 17, 2010
    Messages:
    11,850
    Likes Received:
    2,146
    Gender:
    Male
    Location:
    Lehmden
    Ratings:
    +3,618 / 28
    Home Country:
    Germany Germany
    Show System Specs
    Hi.
    If you want to do a clean 2.2 install without migrating the database but preserving your flags you can go this way...
    First migrate your db to 2.2 by upgrading your 2.1 installation to 2.2 Then save the flags with flag mover. If you like you can check out 2.2 and do some experiments. If you are done remove MP 2.2 completely incl the program data folder. (excerpt for the flag mover files/folders of course)... Now install 2.2 from scratch and import the flags with flag mover.
    Sounds complicated but it takes not that long as the migration is pretty fast. Saving the 2.1 flags with MP2-Buddy will take longer, I'm sure... And it's a one time only thing...
     
  6. aspik
    • Team MediaPortal

    aspik Development Group

    Joined:
    April 14, 2008
    Messages:
    1,317
    Likes Received:
    360
    Ratings:
    +587 / 1
    No. It was planned to make a version for 2.1.3, but with the DB migration in 2.2 I don't think its needed anymore. If you want to do clean install coming from 2.1.3, Lehmden's description is a good (one time) solution.
    So far I didn't received any feedback how the recent version is working, so either test it on a test system or wait for feedback from others. Also, the possibility to choose the path for export/import files is still wip.
     
  7. JSchuricht
    • Premium Supporter

    JSchuricht MP Donator

    Joined:
    January 13, 2009
    Messages:
    153
    Likes Received:
    12
    Gender:
    Male
    Occupation:
    Chemical Mechanical Planarization
    Location:
    Arizona
    Ratings:
    +23 / 0
    Home Country:
    United States of America United States of America
    Show System Specs
    The DB migrates from 2.1.3 to 2.2, just the watch flags for all users are left behind. I'll run it again tonight and pull logs for a bug report. Thats my hangup right now, no way to move watched flags from 2.1.3 to 2.2.
     
  8. ge2301
    • Team MediaPortal

    ge2301 MP2 Design

    Joined:
    January 11, 2014
    Messages:
    6,163
    Likes Received:
    1,554
    Gender:
    Male
    Occupation:
    Automotive Industry
    Location:
    Stuttgart (But living abroad)
    Ratings:
    +2,339 / 2
    Home Country:
    Germany Germany
    What do you mean with “for all users”. MP2.1.3 had no users and after 2.2 migration you have only one admin profile, which should have the watched flags. If you see more users something is wrong.
     
  9. JSchuricht
    • Premium Supporter

    JSchuricht MP Donator

    Joined:
    January 13, 2009
    Messages:
    153
    Likes Received:
    12
    Gender:
    Male
    Occupation:
    Chemical Mechanical Planarization
    Location:
    Arizona
    Ratings:
    +23 / 0
    Home Country:
    United States of America United States of America
    Show System Specs
    I run a standalone MP 2.1.3 server and separate clients. Each client acts as a user with its own watched flags. Morpheus description.
    I also have a plugin Morpheus provided for switching user profiles in 2.1.3. In 2.2, the user account as well as the admin account exist as selections. It didn't make any difference which user I selected in 2.2, all had no watched flags. The exception was after running MP2 buddy I was able to transfer series watched flags.
     
  10. ge2301
    • Team MediaPortal

    ge2301 MP2 Design

    Joined:
    January 11, 2014
    Messages:
    6,163
    Likes Received:
    1,554
    Gender:
    Male
    Occupation:
    Automotive Industry
    Location:
    Stuttgart (But living abroad)
    Ratings:
    +2,339 / 2
    Home Country:
    Germany Germany
    Did you try it without following the description and using the plugin once? I’m not sure, if the plugin is compatible and it might cause the trouble. To know better we need your log files after migration, otherwise everything is speculation.
     
  11. aspik
    • Team MediaPortal

    aspik Development Group

    Joined:
    April 14, 2008
    Messages:
    1,317
    Likes Received:
    360
    Ratings:
    +587 / 1
    Attached a new version with the option to select where to save and from where restore the JSON files. To update the existing version, just overwrite the content of the FlagMover directory with with new one.

    I decided to make a version for 2.1.3 after all. Its even already ready, but I won't post it because after a quick test I discovered a bug in the series episode numbers retrieval.

    @henso
    I suppose its the same bug which we discovered in 2.2. Could you please check for 2.1.3 if you also get double episode numbers? If you can confirm this, then I have no idea how to deal with it in the 2.1.3 version... maybe you have?
     

    Attached Files:

    Last edited: October 7, 2018
    • Like Like x 1
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!