mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-07-16 08:37:45 +02:00
2020-09-22 Fred Gleason <fredg@paravelsystems.com>
* Added 'FEEDS.CHANNEL_IMAGE_ID_IDX', 'FEEDS.DEFAULT_ITEM_IMAGE_ID_IDX' and 'PODCASTS.ITEM_IMAGE_ID_IDX' indexes to the database. * Incremented the database version to 337. * Added a sanity check to the 'Image Manager' dialog in rdadmin(1) to prevent deletion of in-use images. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
parent
9ae7f909cb
commit
2cc77de8de
@ -20306,3 +20306,9 @@
|
||||
2020-09-22 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Added a 'PostImage' method to the Web API.
|
||||
* Added a 'RemoveImage' method to the Web API.
|
||||
2020-09-22 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Added 'FEEDS.CHANNEL_IMAGE_ID_IDX', 'FEEDS.DEFAULT_ITEM_IMAGE_ID_IDX'
|
||||
and 'PODCASTS.ITEM_IMAGE_ID_IDX' indexes to the database.
|
||||
* Incremented the database version to 337.
|
||||
* Added a sanity check to the 'Image Manager' dialog in
|
||||
rdadmin(1) to prevent deletion of in-use images.
|
||||
|
@ -24,7 +24,7 @@
|
||||
/*
|
||||
* Current Database Version
|
||||
*/
|
||||
#define RD_VERSION_DATABASE 336
|
||||
#define RD_VERSION_DATABASE 337
|
||||
|
||||
|
||||
#endif // DBVERSION_H
|
||||
|
@ -167,9 +167,52 @@ void ListImages::deleteData()
|
||||
QString err_msg="";
|
||||
QString sql;
|
||||
RDSqlQuery *q=NULL;
|
||||
int channel_ids=0;
|
||||
int channel_default_ids=0;
|
||||
int item_ids=0;
|
||||
|
||||
if((row=SelectedRow())>=0) {
|
||||
sql=QString("select FILE_EXTENSION from FEED_IMAGES where ")+
|
||||
sql=QString("select ")+
|
||||
"ID "+
|
||||
"from FEEDS where "+
|
||||
QString().sprintf("CHANNEL_IMAGE_ID=%d",list_model->imageId(row));
|
||||
q=new RDSqlQuery(sql);
|
||||
channel_ids=q->size();
|
||||
delete q;
|
||||
|
||||
sql=QString("select ")+
|
||||
"ID "+
|
||||
"from FEEDS where "+
|
||||
QString().sprintf("DEFAULT_ITEM_IMAGE_ID=%d",list_model->imageId(row));
|
||||
q=new RDSqlQuery(sql);
|
||||
channel_default_ids=q->size();
|
||||
delete q;
|
||||
|
||||
sql=QString("select ")+
|
||||
"ID "+
|
||||
"from PODCASTS where "+
|
||||
QString().sprintf("ITEM_IMAGE_ID=%d",list_model->imageId(row));
|
||||
q=new RDSqlQuery(sql);
|
||||
item_ids=q->size();
|
||||
delete q;
|
||||
|
||||
if((channel_ids>0)||(channel_default_ids>0)||(item_ids>0)) {
|
||||
QString msg=tr("Image is in use as")+" ";
|
||||
if(channel_ids>0) {
|
||||
msg+=tr("a channel image")+", ";
|
||||
}
|
||||
if(channel_default_ids>0) {
|
||||
msg+=tr("a default item image")+", ";
|
||||
}
|
||||
if(item_ids>0) {
|
||||
msg+=tr("an item image")+", ";
|
||||
}
|
||||
msg=msg.left(msg.length()-2)+".";
|
||||
QMessageBox::warning(this,"RDAdmin - "+tr("Image in Use"),msg);
|
||||
return;
|
||||
}
|
||||
|
||||
sql=QString("select ID from FEED_IMAGES where ")+
|
||||
QString().sprintf("ID=%d",list_model->imageId(row));
|
||||
q=new RDSqlQuery(sql);
|
||||
if(q->first()) {
|
||||
|
@ -5466,6 +5466,26 @@ Stále ještě jej chcete smazat?</translation>
|
||||
<source>Image upload failed!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Image is in use as</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>a channel image</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>a default item image</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>an item image</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Image in Use</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ListLiveWireGpios</name>
|
||||
|
@ -5232,6 +5232,26 @@ Generieren</translation>
|
||||
<source>Image upload failed!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Image is in use as</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>a channel image</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>a default item image</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>an item image</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Image in Use</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ListLiveWireGpios</name>
|
||||
|
@ -5429,6 +5429,26 @@ Do you still want to delete it?</source>
|
||||
<source>Image upload failed!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Image is in use as</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>a channel image</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>a default item image</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>an item image</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Image in Use</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ListLiveWireGpios</name>
|
||||
|
@ -4377,6 +4377,26 @@ Permissions</source>
|
||||
<source>Image upload failed!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Image is in use as</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>a channel image</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>a default item image</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>an item image</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Image in Use</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ListLiveWireGpios</name>
|
||||
|
@ -5101,6 +5101,26 @@ Klikk på "Lisens"-knappen for fleire opplysningar.</translation>
|
||||
<source>Image upload failed!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Image is in use as</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>a channel image</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>a default item image</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>an item image</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Image in Use</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ListLiveWireGpios</name>
|
||||
|
@ -5101,6 +5101,26 @@ Klikk på "Lisens"-knappen for fleire opplysningar.</translation>
|
||||
<source>Image upload failed!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Image is in use as</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>a channel image</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>a default item image</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>an item image</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Image in Use</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ListLiveWireGpios</name>
|
||||
|
@ -5216,6 +5216,26 @@ Você ainda quer Deletar?</translation>
|
||||
<source>Image upload failed!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Image is in use as</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>a channel image</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>a default item image</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>an item image</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Image in Use</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ListLiveWireGpios</name>
|
||||
|
@ -40,6 +40,17 @@ bool MainObject::RevertSchema(int cur_schema,int set_schema,QString *err_msg)
|
||||
// NEW SCHEMA REVERSIONS GO HERE...
|
||||
|
||||
|
||||
//
|
||||
// Revert 337
|
||||
//
|
||||
if((cur_schema==337)&&(set_schema<cur_schema)) {
|
||||
DropIndex("PODCASTS","ITEM_IMAGE_ID_IDX");
|
||||
DropIndex("FEEDS","DEFAULT_ITEM_IMAGE_ID_IDX");
|
||||
DropIndex("FEEDS","CHANNEL_IMAGE_ID_IDX");
|
||||
WriteSchemaVersion(--cur_schema);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Revert 336
|
||||
//
|
||||
|
@ -161,7 +161,7 @@ void MainObject::InitializeSchemaMap() {
|
||||
global_version_map["3.2"]=311;
|
||||
global_version_map["3.3"]=314;
|
||||
global_version_map["3.4"]=317;
|
||||
global_version_map["4.0"]=336;
|
||||
global_version_map["4.0"]=337;
|
||||
}
|
||||
|
||||
|
||||
|
@ -10263,10 +10263,29 @@ bool MainObject::UpdateSchema(int cur_schema,int set_schema,QString *err_msg)
|
||||
if(!RDSqlQuery::apply(sql,err_msg)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
WriteSchemaVersion(++cur_schema);
|
||||
}
|
||||
|
||||
if((cur_schema<337)&&(set_schema>cur_schema)) {
|
||||
sql=QString("alter table FEEDS ")+
|
||||
"add index CHANNEL_IMAGE_ID_IDX(CHANNEL_IMAGE_ID)";
|
||||
if(!RDSqlQuery::apply(sql,err_msg)) {
|
||||
return false;
|
||||
}
|
||||
sql=QString("alter table FEEDS ")+
|
||||
"add index DEFAULT_ITEM_IMAGE_ID_IDX(DEFAULT_ITEM_IMAGE_ID)";
|
||||
if(!RDSqlQuery::apply(sql,err_msg)) {
|
||||
return false;
|
||||
}
|
||||
sql=QString("alter table PODCASTS ")+
|
||||
"add index ITEM_IMAGE_ID_IDX(ITEM_IMAGE_ID)";
|
||||
if(!RDSqlQuery::apply(sql,err_msg)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
WriteSchemaVersion(++cur_schema);
|
||||
}
|
||||
|
||||
|
||||
// NEW SCHEMA UPDATES GO HERE...
|
||||
|
Loading…
x
Reference in New Issue
Block a user