mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-11-27 07:40:11 +01: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();
|
||||
|
||||
Reference in New Issue
Block a user