mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-05-28 14:42:34 +02:00
2022-09-20 Fred Gleason <fredg@paravelsystems.com>
* Changed the 'RECORDINGS.URL_PASSWORD' from 'varchar(64)' to 'text'. * Base64 encoded the contents of the 'RECORDINGS.URL_PASSWORD' field. * Incremented the database version to 358. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
parent
0d4dd0b635
commit
de1908cb53
@ -23345,3 +23345,7 @@
|
||||
2022-09-20 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Added an appendix 'Creating and Configuring a Secure Shell Identity
|
||||
Key-pair for Rivendell' to the Operations Guide.
|
||||
2022-09-20 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Changed the 'RECORDINGS.URL_PASSWORD' from 'varchar(64)' to 'text'.
|
||||
* Base64 encoded the contents of the 'RECORDINGS.URL_PASSWORD' field.
|
||||
* Incremented the database version to 358.
|
||||
|
@ -24,7 +24,7 @@
|
||||
/*
|
||||
* Current Database Version
|
||||
*/
|
||||
#define RD_VERSION_DATABASE 357
|
||||
#define RD_VERSION_DATABASE 358
|
||||
|
||||
|
||||
#endif // DBVERSION_H
|
||||
|
@ -603,13 +603,13 @@ void RDRecording::setUrlUsername(QString name) const
|
||||
|
||||
QString RDRecording::urlPassword() const
|
||||
{
|
||||
return GetStringValue("URL_PASSWORD");
|
||||
return QByteArray::fromBase64(GetStringValue("URL_PASSWORD").toUtf8());
|
||||
}
|
||||
|
||||
|
||||
void RDRecording::setUrlPassword(QString passwd) const
|
||||
{
|
||||
SetRow("URL_PASSWORD",passwd);
|
||||
SetRow("URL_PASSWORD",QString(passwd.toUtf8().toBase64()));
|
||||
}
|
||||
|
||||
|
||||
|
@ -1948,7 +1948,7 @@ void MainObject::LoadEvent(RDSqlQuery *q,CatchEvent *e,bool add)
|
||||
e->setBitrate(q->value(22).toInt());
|
||||
e->setUrl(q->value(37).toString());
|
||||
e->setUrlUsername(q->value(38).toString());
|
||||
e->setUrlPassword(q->value(39).toString());
|
||||
e->setUrlPassword(QByteArray::fromBase64(q->value(39).toString().toUtf8()));
|
||||
e->setUseSshIdentity(q->value(40).toString()=='Y');
|
||||
e->setQuality(q->value(41).toInt());
|
||||
e->setNormalizeLevel(q->value(42).toInt());
|
||||
|
@ -41,6 +41,34 @@ bool MainObject::RevertSchema(int cur_schema,int set_schema,QString *err_msg)
|
||||
// NEW SCHEMA REVERSIONS GO HERE...
|
||||
|
||||
|
||||
//
|
||||
// Revert 358
|
||||
//
|
||||
if((cur_schema==358)&&(set_schema<cur_schema)) {
|
||||
sql=QString("select ")+
|
||||
"`ID`,"+ // 00
|
||||
"`URL_PASSWORD` " // 01
|
||||
"from `RECORDINGS`";
|
||||
q=new RDSqlQuery(sql);
|
||||
while(q->next()) {
|
||||
sql=QString("update `RECORDINGS` set ")+
|
||||
"`URL_PASSWORD`='"+
|
||||
RDEscapeString(QByteArray::fromBase64(q->value(1).toString().toUtf8()))+"' "+
|
||||
QString::asprintf("where `ID`=%u",q->value(0).toUInt());
|
||||
if(!RDSqlQuery::apply(sql,err_msg)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
delete q;
|
||||
sql=QString("alter table `RECORDINGS` ")+
|
||||
"modify column `URL_PASSWORD` varchar(64)";
|
||||
if(!RDSqlQuery::apply(sql,err_msg)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
WriteSchemaVersion(--cur_schema);
|
||||
}
|
||||
|
||||
//
|
||||
// Revert 357
|
||||
//
|
||||
|
@ -160,7 +160,7 @@ void MainObject::InitializeSchemaMap() {
|
||||
global_version_map["3.4"]=317;
|
||||
global_version_map["3.5"]=346;
|
||||
global_version_map["3.6"]=347;
|
||||
global_version_map["4.0"]=357;
|
||||
global_version_map["4.0"]=358;
|
||||
}
|
||||
|
||||
|
||||
|
@ -11022,6 +11022,30 @@ bool MainObject::UpdateSchema(int cur_schema,int set_schema,QString *err_msg)
|
||||
WriteSchemaVersion(++cur_schema);
|
||||
}
|
||||
|
||||
if((cur_schema<358)&&(set_schema>cur_schema)) {
|
||||
sql=QString("alter table `RECORDINGS` modify column `URL_PASSWORD` text");
|
||||
if(!RDSqlQuery::apply(sql,err_msg)) {
|
||||
return false;
|
||||
}
|
||||
sql=QString("select ")+
|
||||
"`ID`,"+ // 00
|
||||
"`URL_PASSWORD` " // 01
|
||||
"from `RECORDINGS`";
|
||||
q=new RDSqlQuery(sql);
|
||||
while(q->next()) {
|
||||
sql=QString("update `RECORDINGS` set ")+
|
||||
"`URL_PASSWORD`='"+
|
||||
RDEscapeString(q->value(1).toString().toUtf8().toBase64())+"' "+
|
||||
QString::asprintf("where `ID`=%u",q->value(0).toUInt());
|
||||
if(!RDSqlQuery::apply(sql,err_msg)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
delete q;
|
||||
|
||||
WriteSchemaVersion(++cur_schema);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// NEW SCHEMA UPDATES GO HERE...
|
||||
|
Loading…
x
Reference in New Issue
Block a user