mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-10 16:43:35 +02:00
2014-10-09 Fred Gleason <fredg@paravelsystems.com>
* Implemented the 'RDXPORT_COMMAND_AUDIOSTORE' web API call in 'web/rdxport/audiostore.cpp', 'web/rdxport/rdxport.cpp' and 'web/rdxport/rdxport.h'. * Added an 'RDAudioStore' class in 'lib/rdaudiostore.cpp' and 'lib/rdaudiostore.h'. * Modified the Desk Gauge widget in 'rdlibrary/disk_gauge.cpp' and 'rdlibrary/disk_gauge.h' to use the 'RDAudioStore' class [fixes GitHub issue #000035].
This commit is contained in:
@@ -31,6 +31,7 @@ install-exec-hook:
|
||||
if test -z $(DESTDIR) ; then chown root $(DESTDIR)$(libexecdir)/rdxport.cgi ; chmod 4755 $(DESTDIR)$(libexecdir)/rdxport.cgi ; fi
|
||||
|
||||
dist_rdxport_cgi_SOURCES = audioinfo.cpp\
|
||||
audiostore.cpp\
|
||||
carts.cpp\
|
||||
copyaudio.cpp\
|
||||
deleteaudio.cpp\
|
||||
|
53
web/rdxport/audiostore.cpp
Normal file
53
web/rdxport/audiostore.cpp
Normal file
@@ -0,0 +1,53 @@
|
||||
// audiostore.cpp
|
||||
//
|
||||
// Rivendell web service portal -- AudioStore service
|
||||
//
|
||||
// (C) Copyright 2014 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License version 2 as
|
||||
// published by the Free Software Foundation.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public
|
||||
// License along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/statvfs.h>
|
||||
#include <sys/vfs.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include <rdformpost.h>
|
||||
#include <rdweb.h>
|
||||
#include <rdcart.h>
|
||||
#include <rdwavefile.h>
|
||||
#include <rdconf.h>
|
||||
|
||||
#include <rdxport.h>
|
||||
|
||||
void Xport::AudioStore()
|
||||
{
|
||||
struct statvfs stat;
|
||||
|
||||
memset(&stat,0,sizeof(stat));
|
||||
if(statvfs(xport_config->audioRoot(),&stat)<0) {
|
||||
XmlExit("Internal Error",400);
|
||||
}
|
||||
printf("Content-type: application/xml\n");
|
||||
printf("Status: 200\n\n");
|
||||
printf("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n");
|
||||
printf("<audioStore>\n");
|
||||
printf(" <freeBytes>%lu</freeBytes>\n",stat.f_bfree*stat.f_bsize);
|
||||
printf(" <totalBytes>%lu</totalBytes>\n",stat.f_blocks*stat.f_bsize);
|
||||
printf("</audioStore>\n");
|
||||
|
||||
Exit(0);
|
||||
}
|
@@ -219,6 +219,10 @@ Xport::Xport(QObject *parent,const char *name)
|
||||
AudioInfo();
|
||||
break;
|
||||
|
||||
case RDXPORT_COMMAND_AUDIOSTORE:
|
||||
AudioStore();
|
||||
break;
|
||||
|
||||
case RDXPORT_COMMAND_LISTLOGS:
|
||||
ListLogs();
|
||||
break;
|
||||
|
@@ -54,6 +54,7 @@ class Xport : public QObject
|
||||
void TrimAudio();
|
||||
void CopyAudio();
|
||||
void AudioInfo();
|
||||
void AudioStore();
|
||||
void ListLogs();
|
||||
void ListLog();
|
||||
void ListServices();
|
||||
|
@@ -26,6 +26,7 @@ install-exec-am:
|
||||
cp addcart.html $(DESTDIR)@libexecdir@
|
||||
cp addcut.html $(DESTDIR)@libexecdir@
|
||||
cp audioinfo.html $(DESTDIR)@libexecdir@
|
||||
cp audiostore.html $(DESTDIR)@libexecdir@
|
||||
cp copyaudio.html $(DESTDIR)@libexecdir@
|
||||
cp delete_audio.html $(DESTDIR)@libexecdir@
|
||||
cp editcart.html $(DESTDIR)@libexecdir@
|
||||
@@ -50,6 +51,7 @@ uninstall:
|
||||
rm -f $(DESTDIR)@libexecdir@/addcart.html
|
||||
rm -f $(DESTDIR)@libexecdir@/addcut.html
|
||||
rm -f $(DESTDIR)@libexecdir@/audioinfo.html
|
||||
rm -f $(DESTDIR)@libexecdir@/audiostore.html
|
||||
rm -f $(DESTDIR)@libexecdir@/copyaudio.html
|
||||
rm -f $(DESTDIR)@libexecdir@/delete_audio.html
|
||||
rm -f $(DESTDIR)@libexecdir@/editcart.html
|
||||
@@ -72,6 +74,7 @@ uninstall:
|
||||
EXTRA_DIST = addcart.html\
|
||||
addcut.html\
|
||||
audioinfo.html\
|
||||
audiostore.html\
|
||||
copyaudio.html\
|
||||
delete_audio.html\
|
||||
editcart.html\
|
||||
|
25
web/tests/audiostore.html
Normal file
25
web/tests/audiostore.html
Normal file
@@ -0,0 +1,25 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Rivendell AUDIOSTORE Service Test Harness</title>
|
||||
<body>
|
||||
<form action="/rd-bin/rdxport.cgi" method="post" enctype="multipart/form-data">
|
||||
<input type="hidden" name="COMMAND" value="23">
|
||||
<table cellpadding="0" cellspacing="2" border="0">
|
||||
<tr>
|
||||
<td align="right">LOGIN NAME:</td>
|
||||
<td><input type="text" name="LOGIN_NAME" size="20" maxlength="255"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">PASSWORD:</td>
|
||||
<td><input type="password" name="PASSWORD" size="20" maxlength="32"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" align="right"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" align="right"><input type="submit" value="OK"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user