sql statement to set watched flag using directory name

Discussion in 'Moving Pictures' started by dihoff, November 12, 2011.

  1. dihoff

    dihoff Portal Pro

    Joined:
    October 29, 2009
    Messages:
    89
    Likes Received:
    5
    Ratings:
    +5 / 0
    Home Country:
    Australia Australia
    hi all,



    installed a mediaportal update recently, and lost all of my config, including the watched flag for my movies! :( i started setting the watched flag again manually, but it's way too time consuming.

    can someone help me with the sql for setting the watched flag? i have all my directories named with ratings, e.g. "Toy Story 3 c2010_++++" - if there's a + it would indicate that the movie has been watched.

    i've installed sql lite, and opened the database, as per this post.

    now, i just need the sql, so, something like:

    update user_movie_settings
    set watched = 1
    where user_movie_settings.id = local_media.id
    and local_media.fullpath like '%+%'

    this obviously being incorrect.

    tia,

    dh.
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. fforde

    fforde Community Plugin Dev

    Joined:
    June 7, 2007
    Messages:
    2,666
    Likes Received:
    1,690
    Occupation:
    Software Engineer
    Location:
    Texas
    Ratings:
    +1,696 / 0
    Home Country:
    United States of America United States of America
    For what its worth every time you run the Moving Pictures installer it backs up your database. You might be able to restore your old data.
     
  4. dihoff

    dihoff Portal Pro

    Joined:
    October 29, 2009
    Messages:
    89
    Likes Received:
    5
    Ratings:
    +5 / 0
    Home Country:
    Australia Australia
    thanks fforde, but there's a lot of big bold writing nowadays warning that restoring old config might cause problems, so i was wary.

    anyway, here's the sql in case it's of use to anyone else:

    update user_movie_settings
    set watched = 1
    where id in (
    select movie_info_id
    from local_media__movie_info
    where local_media_id in (
    select id
    from local_media
    where fullpath like '%+%'))

    cheers,

    dh.
     
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!