1
0
mirror of https://github.com/ElvishArtisan/rivendell.git synced 2025-04-11 23:32:38 +02:00

2017-06-19 Fred Gleason <fredg@paravelsystems.com>

* Added a 'TITLE' field to the 'Import' web call.
This commit is contained in:
Fred Gleason 2017-06-19 14:27:05 -04:00
parent 108fd8c40c
commit 5a3a5015a5
4 changed files with 38 additions and 1 deletions

@ -15849,3 +15849,5 @@
'rdadmin/edit_settings.h'.
* Modified the 'EditCart' web call to enforce the 'Auto-Correct
Duplicate Cart Titles' setting.
2017-06-19 Fred Gleason <fredg@paravelsystems.com>
* Added a 'TITLE' field to the 'Import' web call.

@ -1729,7 +1729,9 @@
<para>
A <computeroutput>404</computeroutput> error will be returned if the
requested cart is not authorized for the specified Rivendell user in
RDAdmin->ManageUsers->AssignGroupPerms.
RDAdmin->ManageUsers->AssignGroupPerms or if the system is configured
to require unique titles and a non-unique title is provided in the
TITLE field.
</para>
<para>
NOTE: The method must be called with 'multipart/form-data' encoding.
@ -1861,6 +1863,18 @@
Optional
</entry>
</row>
<row>
<entry>
TITLE
</entry>
<entry>
The TITLE value for the imported audio. This will override any
value found in in-file metadata.
</entry>
<entry>
Optional
</entry>
</row>
<row>
<entry>
FILENAME

@ -74,6 +74,8 @@ void Xport::Import()
}
QString group_name;
xport_post->getValue("GROUP_NAME",&group_name);
QString title;
xport_post->getValue("TITLE",&title);
QString filename;
if(!xport_post->getValue("FILENAME",&filename)) {
XmlExit("Missing FILENAME",400,"import.cpp",LINE_NUMBER);
@ -107,6 +109,17 @@ void Xport::Import()
XmlExit("Forbidden",404,"import.cpp",LINE_NUMBER);
}
//
// Verify Title Uniqueness
//
if(!title.isEmpty()) {
if((!xport_system->allowDuplicateCartTitles())&&
(!xport_system->fixDuplicateCartTitles())&&
(!RDCart::titleIsUnique(title))) {
XmlExit("Duplicate Cart Title Not Allowed",404,"import.cpp",LINE_NUMBER);
}
}
//
// Load Configuration
//
@ -225,6 +238,9 @@ void Xport::Import()
}
if(resp_code==200) {
cut->setSha1Hash(RDSha1Hash(RDCut::pathName(cut->cutName())));
if(!title.isEmpty()) {
cart->setTitle(title);
}
printf("Content-type: application/xml\n");
printf("Status: %d\n",resp_code);
printf("\n");

@ -50,6 +50,11 @@
<td><input type="text" name="GROUP_NAME" size="20" maxlength="20"></td>
</tr>
<tr>
<tr>
<td align="right">TITLE:</td>
<td><input type="text" name="TITLE" size="40" maxlength="255"></td>
</tr>
<tr>
<td align="right">FILE:</td>
<td><input type="file" name="FILENAME" size="20" maxlength="64"></td>
</tr>