Ticket #10022: 0001-unbreak-default-width-of-preview-picture-on-the-reco.patch

File 0001-unbreak-default-width-of-preview-picture-on-the-reco.patch, 1.5 KB (added by dekarl@…, 14 years ago)

add default setting automatically (upgrading already existing values just as the settings screen does it)

  • includes/db_update.php

    From bf0e53358c918d4358159502db8024659fcad3e0 Mon Sep 17 00:00:00 2001
    From: Karl Dietz <dekarl@users.sourceforge.net>
    Date: Wed, 5 Oct 2011 22:00:40 +0200
    Subject: [PATCH] unbreak default width of preview picture on the recording detail screen
    
    ---
     includes/db_update.php |   13 +++++++++++--
     1 files changed, 11 insertions(+), 2 deletions(-)
    
    diff --git a/includes/db_update.php b/includes/db_update.php
    index f3ebb7f..c7d2df3 100644
    a b  
    99/**/
    1010
    1111// What *should* the database version be?
    12     define('WebDBSchemaVer', 2);
     12    define('WebDBSchemaVer', 3);
    1313
    1414// What version does the database think it is?
    1515    $db_vers = intval(setting('WebDBSchemaVer'));
     
    4040            case 1:
    4141                setting('WebPrefer_Channum', null, 1, false);
    4242                setting('WebDBSchemaVer',    null, ++$db_vers, false);
     43        // Add default width for recording details if they have not been set yet
     44            case 2:
     45                $width = intval(setting('WebFLV_w'));
     46                if ($width < 1) {
     47                    setting('WebFLV_w', null, 320, false);
     48                } elseif ($width < 160) {
     49                    setting('WebFLV_w', null, 160, false);
     50                }
     51                setting('WebDBSchemaVer',    null, ++$db_vers, false);
    4352        // All other numbers should run their changes sequentially
    44             #case 2:
     53            #case 3:
    4554            #    # do something to upgrade the database here
    4655            #    $db_vers++;
    4756        }