Ticket #1308: transcoded_flag.patch

File transcoded_flag.patch, 3.5 KB (added by derek@…, 14 years ago)

Add transcoded flag to recorded table

  • libs/libmythtv/jobqueue.cpp

     
    19051905                                    .arg(PrettyPrint(origfilesize))
    19061906                                    .arg(PrettyPrint(filesize));
    19071907            ChangeJobStatus(jobID, JOB_FINISHED, comment);
     1908            program_info->SetTranscoded(TRANSCODING_COMPLETE);
    19081909
    19091910            MythEvent me("RECORDING_LIST_CHANGE");
    19101911            gContext->dispatch(me);
  • libs/libmythtv/dbcheck.cpp

     
    1010#include "mythdbcon.h"
    1111
    1212/// This is the DB schema version expected by the running MythTV instance.
    13 const QString currentDatabaseVersion = "1124";
     13const QString currentDatabaseVersion = "1125";
    1414
    1515static bool UpdateDBVersionNumber(const QString &newnumber);
    1616static bool performActualUpdate(const QString updates[], QString version,
     
    20162016            return false;
    20172017    }
    20182018
     2019    if(dbver == "1124")
     2020    {
     2021       const QString updates[] = {
     2022"ALTER TABLE recorded ADD COLUMN transcoded TINYINT(1) NOT NULL DEFAULT 0;",
     2023"UPDATE recorded SET transcoded=1;",
     2024""
     2025};
     2026        if (!performActualUpdate(updates, "1125", dbver))
     2027            return false;
     2028    }
     2029
    20192030// Drop xvmc_buffer_settings table in 0.20
    20202031// Drop dvb_dmx_buf_size and dvb_pkt_buf_size columns of channel in 0.20
    20212032
  • libs/libmythtv/programinfo.h

     
    3838    COMM_FLAG_COMMFREE = 3
    3939};
    4040
     41enum TranscodingResults {
     42    TRANSCODING_INCOMPLETE = 0,
     43    TRANSCODING_COMPLETE = 1
     44};
     45
    4146enum TranscoderStatus {
    4247    TRANSCODE_QUEUED      = 0x01,
    4348    TRANSCODE_RETRY       = 0x02,
     
    197202    void SetBookmark(long long pos) const;
    198203    void SetEditing(bool edit) const;
    199204    void SetDeleteFlag(bool deleteFlag) const;
     205    void SetTranscoded(int flag) const;
    200206    void SetCommFlagged(int flag) const; // 1 = flagged, 2 = processing
    201207    void SetAutoExpire(int autoExpire) const;
    202208    void SetPreserveEpisode(bool preserveEpisode) const;
  • libs/libmythtv/programinfo.cpp

     
    18791879    return false;
    18801880}
    18811881
     1882/** \fn ProgramInfo::SetTranscoded(int) const
     1883 *  \brief Set "transcoded" field in "recorded" table to "flag".
     1884 *  \param flag value to set transcoded field to.
     1885 */
     1886void ProgramInfo::SetTranscoded(int flag) const
     1887{
     1888    MSqlQuery query(MSqlQuery::InitCon());
     1889
     1890    query.prepare("UPDATE recorded"
     1891                 " SET transcoded = :FLAG"
     1892                 " WHERE chanid = :CHANID"
     1893                 " AND starttime = :STARTTIME ;");
     1894    query.bindValue(":FLAG", flag);
     1895    query.bindValue(":CHANID", chanid);
     1896    query.bindValue(":STARTTIME", recstartts);
     1897
     1898    if(!query.exec() || !query.isActive())
     1899        MythContext::DBError("Transcoded status update",
     1900                             query);
     1901}
     1902
    18821903/** \fn ProgramInfo::SetCommFlagged(int) const
    18831904 *  \brief Set "commflagged" field in "recorded" table to "flag".
    18841905 *  \param flag value to set commercial flagging field to.