Exemplo n.º 1
0
    public bool MakeNfo (int movieId)
    {
      string moviePath = string.Empty;
      string movieFile = string.Empty;
      ArrayList movieFiles = new ArrayList();
      ArrayList nfoFiles = new ArrayList();
      string nfoFile = string.Empty;
      int fileCounter = 0;

      try
      {
        // Get files
        GetFilesForMovie(movieId, ref movieFiles);

        foreach (string file in movieFiles)
        {
          if (!File.Exists(file))
          {
            return false;
          }

          movieFile = file;
          Util.Utils.Split(movieFile, out moviePath, out movieFile);

          // Check for DVD folder
          if (movieFile.ToUpperInvariant() == "VIDEO_TS.IFO" || movieFile.ToUpperInvariant() == "INDEX.BDMV")
          {
            // Remove \VIDEO_TS from directory structure
            string directoryDVD = moviePath.Substring(0, moviePath.LastIndexOf(@"\"));

            if (Directory.Exists(directoryDVD))
            {
              moviePath = directoryDVD;
              movieFile = directoryDVD;
            }
          }
          else
          {
            if (fileCounter > 0)
            {
              return true;
            }
          }
          // remove stack endings (CDx..) form filename
          Util.Utils.RemoveStackEndings(ref movieFile);
          // Remove file extension
          movieFile = Util.Utils.GetFilename(movieFile, true).Trim();
          // Add nfo extension
          nfoFile = moviePath + @"\" + movieFile + ".nfo";
          Util.Utils.FileDelete(nfoFile);
          nfoFiles.Add(nfoFile);
          //}

          IMDBMovie movieDetails = new IMDBMovie();
          GetMovieInfoById(movieId, ref movieDetails);
          // Prepare XML
          XmlDocument doc = new XmlDocument();
          XmlDeclaration xmldecl = doc.CreateXmlDeclaration("1.0", "UTF-8", null);

          // Main tag
          XmlNode mainNode = doc.CreateElement("movie");
          XmlNode subNode;

          #region Movie fields

          // Filenames
          foreach (string strMovieFile in movieFiles)
          {
            CreateXmlNode(mainNode, doc, "filenameandpath", strMovieFile);
          }

          // Title
          CreateXmlNode(mainNode, doc, "title", movieDetails.Title);
          // Sort Title
          if (!string.IsNullOrEmpty(movieDetails.SortTitle))
          {
            CreateXmlNode(mainNode, doc, "sorttitle", movieDetails.SortTitle);
          }
          else
          {
            CreateXmlNode(mainNode, doc, "sorttitle", movieDetails.Title);
          }

          //  movie IMDB number
          CreateXmlNode(mainNode, doc, "imdb", movieDetails.IMDBNumber);
          CreateXmlNode(mainNode, doc, "id", movieDetails.IMDBNumber);
          //  Language
          CreateXmlNode(mainNode, doc, "language", movieDetails.Language);
          //  Country
          CreateXmlNode(mainNode, doc, "country", movieDetails.Country);
          //  Year
          CreateXmlNode(mainNode, doc, "year", movieDetails.Year.ToString());
          //  Rating
          CreateXmlNode(mainNode, doc, "rating", movieDetails.Rating.ToString().Replace(",", "."));
          //  Runtime
          CreateXmlNode(mainNode, doc, "runtime", movieDetails.RunTime.ToString());
          // MPAA
          CreateXmlNode(mainNode, doc, "mpaa", movieDetails.MPARating);
          // Votes
          CreateXmlNode(mainNode, doc, "votes", movieDetails.Votes);
          // TOp 250
          CreateXmlNode(mainNode, doc, "top250", movieDetails.Top250.ToString());
          // Studio
          CreateXmlNode(mainNode, doc, "studio", movieDetails.Studios);
          //  Director
          CreateXmlNode(mainNode, doc, "director", movieDetails.Director);
          //  Director imdbId
          CreateXmlNode(mainNode, doc, "directorimdb", GetActorImdbId(movieDetails.ID));
          // Credits
          CreateXmlNode(mainNode, doc, "credits", movieDetails.WritingCredits);
          // Tagline
          CreateXmlNode(mainNode, doc, "tagline", movieDetails.TagLine);
          // Plot outline (short one)
          CreateXmlNode(mainNode, doc, "outline", movieDetails.PlotOutline);
          // Plot - long
          CreateXmlNode(mainNode, doc, "plot", movieDetails.Plot);
          // Review
          CreateXmlNode(mainNode, doc, "review", movieDetails.UserReview);
          // Watched
          string watched = "false";

          if (movieDetails.Watched > 0)
          {
            watched = "true";
          }

          CreateXmlNode(mainNode, doc, "watched", watched);

          // Watched count
          int percent = 0;
          int watchedCount = 0;
          GetMovieWatchedStatus(movieId, out percent, out watchedCount);
          CreateXmlNode(mainNode, doc, "playcount", watchedCount.ToString());

          // Poster
          string titleExt = movieDetails.Title + "{" + movieId + "}";
          string largeCoverArtImage = Util.Utils.GetLargeCoverArtName(Thumbs.MovieTitle, titleExt);
          string coverFilename = moviePath + @"\" + movieFile + ".jpg";

          if (File.Exists(largeCoverArtImage))
          {
            try
            {
              File.Copy(largeCoverArtImage, coverFilename, true);
              File.SetAttributes(coverFilename, FileAttributes.Normal);
              CreateXmlNode(mainNode, doc, "thumb", movieFile + ".jpg");
            }
            catch (Exception ex)
            {
              Log.Info("VideoDatabase: Error in creating nfo - poster node:{0}", ex.Message);
            }
          }

          // Fanart
          string faFile = string.Empty;
          subNode = doc.CreateElement("fanart");

          for (int i = 0; i < 5; i++)
          {
            FanArt.GetFanArtfilename(movieId, i, out faFile);
            string index = string.Empty;

            if (File.Exists(faFile))
            {
              if (i > 0)
              {
                index = i.ToString();
              }

              try
              {
                string faFilename = moviePath + @"\" + movieFile + "-fanart" + index + ".jpg";
                File.Copy(faFile, faFilename, true);
                File.SetAttributes(faFilename, FileAttributes.Normal);
                CreateXmlNode(subNode, doc, "thumb", movieFile + "-fanart" + index + ".jpg");
              }
              catch (Exception ex)
              {
                Log.Info("VideoDatabas: Error in creating nfo - fanart section:{0}", ex.Message);
              }

            }
          }
          mainNode.AppendChild(subNode);

          // Genre
          string szGenres = movieDetails.Genre;

          if (szGenres.IndexOf("/") >= 0 || szGenres.IndexOf("|") >= 0)
          {
            Tokens f = new Tokens(szGenres, new[] {'/', '|'});

            foreach (string strGenre in f)
            {
              if (!string.IsNullOrEmpty(strGenre))
              {
                CreateXmlNode(mainNode, doc, "genre", strGenre.Trim());
              }
            }
          }
          else
          {
            CreateXmlNode(mainNode, doc, "genre", movieDetails.Genre);
          }

          // Cast
          ArrayList castList = new ArrayList();
          GetActorsByMovieID(movieId, ref castList);

          foreach (string actor in castList)
          {
            IMDBActor actorInfo = new IMDBActor();
            subNode = doc.CreateElement("actor");

            char[] splitter = {'|'};
            string[] temp = actor.Split(splitter);
            actorInfo = GetActorInfo(Convert.ToInt32(temp[0]));

            CreateXmlNode(subNode, doc, "name", temp[1]);
            CreateXmlNode(subNode, doc, "role", temp[3]);
            CreateXmlNode(subNode, doc, "imdb", temp[2]);

            if (actorInfo != null)
            {
              CreateXmlNode(subNode, doc, "thumb", actorInfo.ThumbnailUrl);
              CreateXmlNode(subNode, doc, "birthdate", actorInfo.DateOfBirth);
              CreateXmlNode(subNode, doc, "birthplace", actorInfo.PlaceOfBirth);
              CreateXmlNode(subNode, doc, "deathdate", actorInfo.DateOfDeath);
              CreateXmlNode(subNode, doc, "deathplace", actorInfo.PlaceOfDeath);
              CreateXmlNode(subNode, doc, "minibiography", actorInfo.MiniBiography);
              CreateXmlNode(subNode, doc, "biography", actorInfo.Biography);
            }

            mainNode.AppendChild(subNode);
          }

          // User groups
          ArrayList userGroups = new ArrayList();
          GetMovieUserGroups(movieId, userGroups);

          if (userGroups.Count > 0)
          {
            foreach (string userGroup in userGroups)
            {
              CreateXmlNode(mainNode, doc, "set", userGroup);
            }
          }

          // Trailer
          CreateXmlNode(mainNode, doc, "trailer", string.Empty);

          #endregion

          // End and save
          doc.AppendChild(mainNode);
          doc.InsertBefore(xmldecl, mainNode);
          doc.Save(nfoFile);
          fileCounter++;
        }
      }
      catch(Exception ex)
      {
        Log.Info("VideoDatabase: Error in creating nfo file:{0} Error:{1}", nfoFile ,ex.Message);
        return false;
      }

      return true;
    }
Exemplo n.º 2
0
    public void SetMovieInfoById(int lMovieId, ref IMDBMovie details, bool updateTimeStamp)
    {
      try
      {
        details.ID = lMovieId;

        IMDBMovie details1 = details;
        IMDBMovie existingDetails = new IMDBMovie();
        VideoDatabase.GetMovieInfoById(details1.ID, ref existingDetails);
        // Cast
        string strLine = details1.Cast;
        DatabaseUtility.RemoveInvalidChars(ref strLine);
        details1.Cast = strLine;
        // Director
        strLine = details1.Director;
        DatabaseUtility.RemoveInvalidChars(ref strLine);
        details1.Director = strLine;
        // add director Id
        int lDirector = - 1;
        
        if (details1.DirectorID < 1 && !string.IsNullOrEmpty(details1.Director))
        {
          lDirector = AddActor("", details1.Director);
          AddActorToMovie(details1.ID, lDirector, GUILocalizeStrings.Get(199).Replace(":", string.Empty));
          
          if (!CheckMovieImdbId(details1.IMDBNumber))
          {
            // Add actors from cast
            ArrayList vecActors = new ArrayList();
            ArrayList vecRoles = new ArrayList();
            
            if (details1.Cast != Strings.Unknown)
            {
              string castFix = details1.Cast.Replace("''", "'");
              char[] splitter = { '\n', ',' };
              string[] actors = castFix.Split(splitter);

              for (int i = 0; i < actors.Length; ++i)
              {
                int pos = actors[i].IndexOf(" as ");
                string actor = actors[i];
                string role = string.Empty;
                
                if (pos >= 0)
                {
                  if (actor.Length >= pos + 4)
                  {
                    role = actor.Substring(pos + 4);
                  }
                  actor = actors[i].Substring(0, pos);
                }
                
                actor = actor.Trim();
                role = role.Trim();
                int lActorId = AddActor(string.Empty, actor);
                vecActors.Add(lActorId);
                vecRoles.Add(role);
              }
            }
            
            for (int i = 0; i < vecActors.Count; i++)
            {
              AddActorToMovie(lMovieId, (int)vecActors[i], (string)vecRoles[i]);
            }
          }
        }
        else
        {
          lDirector = details1.DirectorID;
        }
        // Plot
        strLine = details1.Plot;
        DatabaseUtility.RemoveInvalidChars(ref strLine);
        details1.Plot = strLine;
        // User Review
        strLine = details1.UserReview;
        DatabaseUtility.RemoveInvalidChars(ref strLine);
        details1.UserReview = strLine;
        // Plot outline
        strLine = details1.PlotOutline;
        DatabaseUtility.RemoveInvalidChars(ref strLine);
        details1.PlotOutline = strLine;
        // Tagline
        strLine = details1.TagLine;
        DatabaseUtility.RemoveInvalidChars(ref strLine);
        details1.TagLine = strLine;
        // Cover
        strLine = details1.ThumbURL;
        DatabaseUtility.RemoveInvalidChars(ref strLine);
        details1.ThumbURL = strLine;
        // Fanart
        strLine = details1.FanartURL;
        DatabaseUtility.RemoveInvalidChars(ref strLine);
        details1.FanartURL = strLine;
        // Date Added
        details1.DateAdded = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
        // Date Watched
        if (details1.DateWatched == string.Empty && existingDetails.ID >= 0)
        {
          details1.DateWatched = existingDetails.DateWatched;
        }
        if (string.IsNullOrEmpty(details1.DateWatched))
        {
          details1.DateWatched = "0001-01-01 00:00:00";
        }
        // Watched status
        if (details1.Watched < 1 && existingDetails.ID >= 0)
        {
          details1.Watched = existingDetails.Watched;
        }
        // Search string
        strLine = details1.SearchString;
        DatabaseUtility.RemoveInvalidChars(ref strLine);
        details1.SearchString = strLine;
        // Title
        strLine = details1.Title.Trim();
        DatabaseUtility.RemoveInvalidChars(ref strLine);
        details1.Title = strLine;
        // SortTtitle
        strLine = details1.SortTitle.Trim();

        if (!string.IsNullOrEmpty(strLine))
        {
          DatabaseUtility.RemoveInvalidChars(ref strLine);
          details1.SortTitle = strLine;
        }
        else
        {
          details1.SortTitle = details1.Title;
        }
        // Votes
        strLine = details1.Votes;
        DatabaseUtility.RemoveInvalidChars(ref strLine);
        details1.Votes = strLine;
        // Writers
        strLine = details1.WritingCredits;
        DatabaseUtility.RemoveInvalidChars(ref strLine);
        details1.WritingCredits = strLine;
        // Genres
        //Clear old genres link for movie
        RemoveGenresForMovie(lMovieId);
        strLine = details1.Genre;
        DatabaseUtility.RemoveInvalidChars(ref strLine);
        details1.Genre = strLine;
        // IMDB Movie ID
        strLine = details1.IMDBNumber;
        DatabaseUtility.RemoveInvalidChars(ref strLine);
        details1.IMDBNumber = strLine;
        // MPAA Rating
        strLine = details1.MPARating;
        DatabaseUtility.RemoveInvalidChars(ref strLine);
        details1.MPARating = strLine;
        // Studios
        strLine = details1.Studios;
        DatabaseUtility.RemoveInvalidChars(ref strLine);
        details1.Studios = strLine;
        // Country
        strLine = details1.Country;
        DatabaseUtility.RemoveInvalidChars(ref strLine);
        details1.Country = strLine;
        // Language
        strLine = details1.Language;
        DatabaseUtility.RemoveInvalidChars(ref strLine);
        details1.Language = strLine;
        // Last update
        if (updateTimeStamp)
        {
          details1.LastUpdate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
        }
        else
        {
          details1.LastUpdate = existingDetails.LastUpdate;
        }
        // add all genres
        string szGenres = details.Genre;
        ArrayList vecGenres = new ArrayList();
        
        if (szGenres != Strings.Unknown)
        {
          if (szGenres.IndexOf("/") >= 0 || szGenres.IndexOf("|") >= 0)
          {
            Tokens f = new Tokens(szGenres, new[] {'/', '|'});
            foreach (string strGenre in f)
            {
              strGenre.Trim();
              if (!string.IsNullOrEmpty(strGenre))
              {
                int lGenreId = AddGenre(strGenre);
                vecGenres.Add(lGenreId);
              }
            }
          }
          else
          {
            string strGenre = details.Genre;
            strGenre.Trim();
            int lGenreId = AddGenre(strGenre);
            vecGenres.Add(lGenreId);
          }
        }
        
        for (int i = 0; i < vecGenres.Count; ++i)
        {
          AddGenreToMovie(lMovieId, (int)vecGenres[i]);
        }

        string strRating = String.Format("{0}", details1.Rating);
        
        if (strRating == "")
        {
          strRating = "0.0";
        }

        string strSQL = String.Format("SELECT * FROM movieinfo WHERE idmovie={0}", lMovieId);
        //	Log.Error("dbs:{0}", strSQL);
        SQLiteResultSet results = m_db.Execute(strSQL);
        
        if (results.Rows.Count == 0)
        {
          // Insert new movie info - no date watched update
          strSQL =
            String.Format(
              "INSERT INTO movieinfo ( idMovie, idDirector, strPlotOutline, strPlot, strTagLine, strVotes, fRating, strCast, strCredits, iYear, strGenre, strPictureURL, strTitle, IMDBID, mpaa, runtime, iswatched, strUserReview, strFanartURL, strDirector, dateAdded, studios, country, language, lastupdate, strSortTitle) VALUES({0},{1},'{2}','{3}','{4}','{5}','{6}','{7}','{8}',{9},'{10}','{11}','{12}','{13}','{14}',{15},{16},'{17}','{18}','{19}','{20}','{21}','{22}','{23}','{24}','{25}')",
              lMovieId, lDirector, details1.PlotOutline,
              details1.Plot, details1.TagLine,
              details1.Votes, strRating,
              details1.Cast, details1.WritingCredits,
              details1.Year, details1.Genre,
              details1.ThumbURL, details1.Title,
              details1.IMDBNumber, details1.MPARating, 
              details1.RunTime, details1.Watched, 
              details1.UserReview, details1.FanartURL, 
              details1.Director, details1.DateAdded, 
              details1.Studios, details1.Country, 
              details1.Language, details1.LastUpdate, details1.SortTitle);

          //			Log.Error("dbs:{0}", strSQL);
          m_db.Execute(strSQL);
          // Update latest movies
          SetLatestMovieProperties();
        }
        else
        {
          // Update movie info (no dateAdded update)
          strSQL =
            String.Format(
              "UPDATE movieinfo SET idDirector={0}, strPlotOutline='{1}', strPlot='{2}', strTagLine='{3}', strVotes='{4}', fRating='{5}', strCast='{6}',strCredits='{7}', iYear={8}, strGenre='{9}', strPictureURL='{10}', strTitle='{11}', IMDBID='{12}', mpaa='{13}', runtime={14}, iswatched={15} , strUserReview='{16}', strFanartURL='{17}' , strDirector ='{18}', dateWatched='{19}', studios = '{20}', country = '{21}', language = '{22}' , lastupdate = '{23}', strSortTitle = '{24}' WHERE idMovie={25}",
              lDirector, details1.PlotOutline,
              details1.Plot, details1.TagLine,
              details1.Votes, strRating,
              details1.Cast, details1.WritingCredits,
              details1.Year, details1.Genre,
              details1.ThumbURL, details1.Title,
              details1.IMDBNumber,
              details1.MPARating, details1.RunTime,
              details1.Watched, details1.UserReview, 
              details1.FanartURL, details1.Director, 
              details1.DateWatched ,details1.Studios,
              details1.Country, details1.Language, 
              details1.LastUpdate, details1.SortTitle,
              lMovieId);

          //		Log.Error("dbs:{0}", strSQL);
          m_db.Execute(strSQL);
        }
        
        VideoDatabase.GetMovieInfoById(details1.ID, ref details1);
      }
      catch (Exception ex)
      {
        Log.Error("videodatabase exception err:{0} src:{2}, stack:{1}", ex.Message, ex.Source, ex.StackTrace);
        Open();
      }
    }
Exemplo n.º 3
0
    // Changed cast fix
    public void SetMovieInfoById(int lMovieId, ref IMDBMovie details)
    {
      try
      {
        details.ID = lMovieId;

        IMDBMovie details1 = details;
        // Cast
        string strLine = details1.Cast;
        DatabaseUtility.RemoveInvalidChars(ref strLine);
        details1.Cast = strLine;
        // Director
        strLine = details1.Director;
        DatabaseUtility.RemoveInvalidChars(ref strLine);
        details1.Director = strLine;
        // Plot
        strLine = details1.Plot;
        DatabaseUtility.RemoveInvalidChars(ref strLine);
        details1.Plot = strLine;
        // User Review
        strLine = details1.UserReview;
        DatabaseUtility.RemoveInvalidChars(ref strLine);
        details1.UserReview = strLine;
        // Plot outline
        strLine = details1.PlotOutline;
        DatabaseUtility.RemoveInvalidChars(ref strLine);
        details1.PlotOutline = strLine;
        // Tagline
        strLine = details1.TagLine;
        DatabaseUtility.RemoveInvalidChars(ref strLine);
        details1.TagLine = strLine;
        // Cover
        strLine = details1.ThumbURL;
        DatabaseUtility.RemoveInvalidChars(ref strLine);
        details1.ThumbURL = strLine;
        // Fanart
        strLine = details1.FanartURL;
        DatabaseUtility.RemoveInvalidChars(ref strLine);
        details1.FanartURL = strLine;
        // Search string
        strLine = details1.SearchString;
        DatabaseUtility.RemoveInvalidChars(ref strLine);
        details1.SearchString = strLine;
        // Title
        strLine = details1.Title;
        DatabaseUtility.RemoveInvalidChars(ref strLine);
        details1.Title = strLine;
        // Votes
        strLine = details1.Votes;
        DatabaseUtility.RemoveInvalidChars(ref strLine);
        details1.Votes = strLine;
        // Writers
        strLine = details1.WritingCredits;
        DatabaseUtility.RemoveInvalidChars(ref strLine);
        details1.WritingCredits = strLine;
        // Genres
        //Clear old genres link for movie
        RemoveGenresForMovie(lMovieId);
        strLine = details1.Genre;
        DatabaseUtility.RemoveInvalidChars(ref strLine);
        details1.Genre = strLine;
        // IMDB Movie ID
        strLine = details1.IMDBNumber;
        DatabaseUtility.RemoveInvalidChars(ref strLine);
        details1.IMDBNumber = strLine;
        // MPAA Rating
        strLine = details1.MPARating;
        DatabaseUtility.RemoveInvalidChars(ref strLine);
        details1.MPARating = strLine;

        // add director
        // Remove actors from movie in case we switch old movie for new one
        RemoveActorsForMovie(lMovieId);
        int lDirector = -1;
        lDirector = AddActor(details.Director);
        AddActorToMovie(lMovieId, lDirector);
        // add all genres
        string szGenres = details.Genre;
        ArrayList vecGenres = new ArrayList();
        if (szGenres != Strings.Unknown)
        {
          if (szGenres.IndexOf("/") >= 0)
          {
            Tokens f = new Tokens(szGenres, new[] {'/'});
            foreach (string strGenre in f)
            {
              strGenre.Trim();
              int lGenreId = AddGenre(strGenre);
              vecGenres.Add(lGenreId);
            }
          }
          else
          {
            string strGenre = details.Genre;
            strGenre.Trim();
            int lGenreId = AddGenre(strGenre);
            vecGenres.Add(lGenreId);
          }
        }
        // add cast... add userreview
        // Changed - Fix double single quota '' duplicate  O'Brian-> O''Brian (removeinvalidchar database method)
        ArrayList vecActors = new ArrayList();
        if (details.Cast != Strings.Unknown)
        {
          string castFix = details.Cast.Replace("''", "'");
          char[] splitter = {'\n', ','};
          string[] actors = castFix.Split(splitter);

          for (int i = 0; i < actors.Length; ++i)
          {
            int pos = actors[i].IndexOf(" as ");
            string actor = actors[i];
            if (pos >= 0)
            {
              actor = actors[i].Substring(0, pos);
            }
            actor = actor.Trim();
            int lActorId = AddActor(actor);
            vecActors.Add(lActorId);
          }
        }
        for (int i = 0; i < vecGenres.Count; ++i)
        {
          AddGenreToMovie(lMovieId, (int)vecGenres[i]);
        }

        for (int i = 0; i < vecActors.Count; i++)
        {
          AddActorToMovie(lMovieId, (int)vecActors[i]);
        }

        string strRating = String.Format("{0}", details1.Rating);
        if (strRating == "")
        {
          strRating = "0.0";
        }
        string strSQL = String.Format("select * from movieinfo where idmovie={0}", lMovieId);
        //	Log.Error("dbs:{0}", strSQL);
        SQLiteResultSet results = m_db.Execute(strSQL);
        if (results.Rows.Count == 0)
        {
          strSQL =
            String.Format(
              "insert into movieinfo ( idMovie, idDirector, strPlotOutline, strPlot, strTagLine, strVotes, fRating, strCast, strCredits, iYear, strGenre, strPictureURL, strTitle, IMDBID, mpaa, runtime, iswatched, strUserReview, strFanartURL) values({0},{1},'{2}','{3}','{4}','{5}','{6}','{7}','{8}',{9},'{10}','{11}','{12}','{13}','{14}',{15},{16},'{17}','{18}')",
              lMovieId, lDirector, details1.PlotOutline,
              details1.Plot, details1.TagLine,
              details1.Votes, strRating,
              details1.Cast, details1.WritingCredits,
              details1.Year, details1.Genre,
              details1.ThumbURL, details1.Title,
              details1.IMDBNumber, details1.MPARating, details1.RunTime, details1.Watched, details1.UserReview,
              details1.FanartURL);

          //			Log.Error("dbs:{0}", strSQL);
          m_db.Execute(strSQL);
        }
        else
        {
          strSQL =
            String.Format(
              "update movieinfo set idDirector={0}, strPlotOutline='{1}', strPlot='{2}', strTagLine='{3}', strVotes='{4}', fRating='{5}', strCast='{6}',strCredits='{7}', iYear={8}, strGenre='{9}', strPictureURL='{10}', strTitle='{11}', IMDBID='{12}', mpaa='{13}', runtime={14}, iswatched={15} , strUserReview='{16}', strFanartURL='{17}' where idMovie={18}",
              lDirector, details1.PlotOutline,
              details1.Plot, details1.TagLine,
              details1.Votes, strRating,
              details1.Cast, details1.WritingCredits,
              details1.Year, details1.Genre,
              details1.ThumbURL, details1.Title,
              details1.IMDBNumber,
              details1.MPARating, details1.RunTime,
              details1.Watched, details1.UserReview, details1.FanartURL, lMovieId);

          //		Log.Error("dbs:{0}", strSQL);
          m_db.Execute(strSQL);
        }
        // Double single quota fix (after scan and executing DatabaseUtility.RemoveInvalidChars method, movie info can contain double single quota
        // which looks ugly on screen and also produce wrong cover thumb filename which leads to duplication of cover
        // for the same movie ie. That's Life{x}L.jpg  and That''s Life{x}L.jpg, this is only visible and reproducable after scan,
        // after is OK)
        {
          details1.PlotOutline = details1.PlotOutline.Replace("''", "'");
          details1.Plot = details1.Plot.Replace("''", "'");
          details1.TagLine = details1.TagLine.Replace("''", "'");
          details1.WritingCredits = details1.WritingCredits.Replace("''", "'");
          details1.Genre = details1.Genre.Replace("''", "'");
          details1.Title = details1.Title.Replace("''", "'");
          details1.UserReview = details1.UserReview.Replace("''", "'");
        }
      }
      catch (Exception ex)
      {
        Log.Error("videodatabase exception err:{0} src:{2}, stack:{1}", ex.Message, ex.Source, ex.StackTrace);
        Open();
      }
    }
Exemplo n.º 4
0
 public TokenEnumerator(Tokens t)
 {
   this.t = t;
 }
Exemplo n.º 5
0
 public TokenEnumerator(Tokens t)
 {
     this.t = t;
 }