8000 move program* and recording* from libmythbase to libmythtv by ulmus-scott · Pull Request #1140 · MythTV/mythtv · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

move program* and recording* from libmythbase to libmythtv #1140

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
8000
Diff view
2 changes: 1 addition & 1 deletion cmake/VersionInformation.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ endif()
#

# See mythtv/libs/libmythbase/mythversion.h.in
set(MYTHTV_BINARY_CHANGED "20220913-1")
set(MYTHTV_BINARY_CHANGED "20250704-1")
set(MYTHTV_BINARY_VERSION "${PROJECT_VERSION_MAJOR}.${MYTHTV_BINARY_CHANGED}")

# See mythtv/bindings/python/MythTV/static.py.in
Expand Down
2 changes: 1 addition & 1 deletion mythplugins/mytharchive/mytharchive/archiveutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <libmythbase/mythdate.h>
#include <libmythbase/mythlogging.h>
#include <libmythbase/mythsystemlegacy.h>
#include <libmythbase/programinfo.h>
#include <libmythtv/programinfo.h>
#include <libmythui/mythdialogbox.h>
#include <libmythui/mythmainwindow.h>

Expand Down
2 changes: 0 additions & 2 deletions mythplugins/mytharchive/mytharchive/exportnative.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
#include <libmythbase/mythdb.h>
#include <libmythbase/mythlogging.h>
#include <libmythbase/mythsystemlegacy.h>
#include <libmythbase/programinfo.h>
#include <libmythbase/remoteutil.h>
#include <libmythbase/stringutil.h>
#include <libmythui/mythdialogbox.h>
#include <libmythui/mythmainwindow.h>
Expand Down
1 change: 1 addition & 0 deletions mythplugins/mytharchive/mytharchive/mythburn.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <utility>

// mythtv
#include <libmythtv/programtypes.h>
#include <libmythui/mythscreentype.h>

// mytharchive
Expand Down
4 changes: 2 additions & 2 deletions mythplugins/mytharchive/mytharchive/recordingselector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
#include <libmythbase/mythdb.h>
#include <libmythbase/mythlogging.h>
#include <libmythbase/mythtimer.h>
#include <libmythbase/programinfo.h>
#include <libmythbase/remoteutil.h>
#include <libmythbase/stringutil.h>
#include <libmythtv/programinfo.h>
#include <libmythtv/programinforemoteutil.h>
#include <libmythui/mythdialogbox.h>
#include <libmythui/mythmainwindow.h>
#include <libmythui/mythprogressdialog.h>
Expand Down
2 changes: 1 addition & 1 deletion mythplugins/mytharchive/mytharchive/thumbfinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
#include <libmythbase/mythdirs.h>
#include <libmythbase/mythlogging.h>
#include <libmythbase/mythmiscutil.h> // for MythFile::copy
#include <libmythbase/programinfo.h>
#include <libmythtv/programinfo.h>
#include <libmythui/mythdialogbox.h>
#include <libmythui/mythimage.h>
#include <libmythui/mythmainwindow.h>
Expand Down
2 changes: 1 addition & 1 deletion mythplugins/mytharchive/mytharchive/thumbfinder.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ extern "C" {

// mythtv
#include <libmyth/mythavframe.h>
#include <libmythbase/programtypes.h>
#include <libmythtv/mythavutil.h>
#include <libmythtv/programtypes.h>
#include <libmythui/mythscreentype.h>

// mytharchive
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@
#include <libmythbase/mythpluginexport.h>
#include <libmythbase/mythsystemlegacy.h>
#include <libmythbase/mythversion.h>
#include <libmythbase/programinfo.h>
#include <libmythtv/mythavutil.h>
#include <libmythtv/programinfo.h>

extern "C" {
#include <libavcodec/avcodec.h>
Expand Down
1 change: 0 additions & 1 deletion mythplugins/mythgame/mythgame/gamescan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include <libmythbase/mythcorecontext.h>
#include <libmythbase/mythevent.h>
#include <libmythbase/mythlogging.h>
#include <libmythbase/remoteutil.h>
#include <libmythui/mythdialogbox.h>
#include <libmythui/mythmainwindow.h>
#include <libmythui/mythprogressdialog.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include <libmythbase/mythversion.h>
#include <libmythbase/netgrabbermanager.h>
#include <libmythbase/netutils.h>
#include <libmythbase/remoteutil.h>
#include <libmythbase/rssmanager.h>

GrabberDownloadThread *gdt = nullptr;
Expand Down
1 change: 0 additions & 1 deletion mythplugins/mythnetvision/mythnetvision/netbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include <libmythbase/mythdirs.h>
#include <libmythbase/mythlogging.h>
#include <libmythbase/remotefile.h>
#include <libmythbase/remoteutil.h>
#include <libmythbase/storagegroup.h>
#include <libmythmetadata/metadataimagedownload.h>
#include <libmythui/mythdialogbox.h>
Expand Down
2 changes: 1 addition & 1 deletion mythtv/configure
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
MYTHTV_VERSION_MAJMIN="36.0"
MYTHTV_LIBVERSION="36"
# See mythtv/libs/libmythbase/mythversion.h.in
MYTHTV_BINARY_VERSION="36.20220913-1"
MYTHTV_BINARY_VERSION="36.20250704-1"
# See bindings/python/MythTV/static.py.in
MYTHTV_PYTHON_OWN_VERSION="(36,0,-1,0)"
# See python/MythTV/services_api/send.py.in
Expand Down
13 changes: 0 additions & 13 deletions mythtv/libs/libmythbase/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,9 @@ set(LIBMYTHBASE_HEADERS
mythtypes.h
netgrabbermanager.h
netutils.h
programinfo.h
programtypes.h
programtypeflags.h
recordingstatus.h
recordingtypes.h
referencecounter.h
referencecounterlist.h
remotefile.h
remoteutil.h
rssparse.h
rssmanager.h
serverpool.h
Expand All @@ -94,7 +88,6 @@ set(LIBMYTHBASE_HEADERS_NOT_INSTALLED
mythsystemprivate.h
mythtimezone.h
portchecker.h
programinfoupdater.h
unzip2.h
unziputil.h)

Expand Down Expand Up @@ -227,14 +220,8 @@ add_library(
netgrabbermanager.cpp
netutils.cpp
portchecker.cpp
programinfo.cpp
programinfoupdater.cpp
programtypes.cpp
recordingstatus.cpp
recordingtypes.cpp
referencecounter.cpp
remotefile.cpp
remoteutil.cpp
rssparse.cpp
rssmanager.cpp
serverpool.cpp
Expand Down
19 changes: 0 additions & 19 deletions mythtv/libs/libmythbase/libmythbase.pro
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,6 @@ HEADERS += configuration.h
HEADERS += mythappname.h
HEADERS += netgrabbermanager.h
HEADERS += netutils.h
HEADERS += programinfo.h
HEADERS += programinfoupdater.h
HEADERS += programtypes.h
HEADERS += programtypeflags.h
HEADERS += recordingstatus.h
HEADERS += recordingtypes.h
HEADERS += remoteutil.h
HEADERS += rssmanager.h
HEADERS += rssparse.h
HEADERS += unziputil.h
Expand Down Expand Up @@ -82,12 +75,6 @@ SOURCES += configuration.cpp
SOURCES += mythversion.cpp
SOURCES += netgrabbermanager.cpp
SOURCES += netutils.cpp
SOURCES += programinfo.cpp
SOURCES += programinfoupdater.cpp
SOURCES += programtypes.cpp
SOURCES += recordingstatus.cpp
SOURCES += recordingtypes.cpp
SOURCES += remoteutil.cpp
SOURCES += rssmanager.cpp
SOURCES += rssparse.cpp
SOURCES += unziputil.cpp
Expand Down Expand Up @@ -200,12 +187,6 @@ inc.files += mythsorthelper.h mythdbcheck.h
inc.files += mythrandom.h
inc.files += netgrabbermanager.h
inc.files += netutils.h
inc.files += programinfo.h
inc.files += programtypes.h
inc.files += programtypeflags.h
inc.files += recordingstatus.h
inc.files += recordingtypes.h
inc.files += remoteutil.h
10000 inc.files += rssmanager.h
inc.files += rssparse.h
inc.files += stringutil.h
Expand Down
51 changes: 51 additions & 0 deletions mythtv/libs/libmythbase/mythmiscutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,57 @@ loadArray getLoadAvgs (void)
return {-1, -1, -1};
}

bool RemoteGetLoad(loadArray& load)
{
QStringList strlist(QString("QUERY_LOAD"));

if (gCoreContext->SendReceiveStringList(strlist) && strlist.size() >= 3)
{
load[0] = strlist[0].toDouble();
load[1] = strlist[1].toDouble();
load[2] = strlist[2].toDouble();
return true;
}

return false;
}

bool RemoteGetUptime(std::chrono::seconds &uptime)
{
QStringList strlist(QString("QUERY_UPTIME"));

if (!gCoreContext->SendReceiveStringList(strlist) || strlist.isEmpty())
return false;

if (strlist[0].isEmpty() || !strlist[0].at(0).isNumber())
return false;

if (sizeof(time_t) == sizeof(int))
uptime = std::chrono::seconds(strlist[0].toUInt());
else if (sizeof(time_t) == sizeof(long))
uptime = std::chrono::seconds(strlist[0].toULong());
else if (sizeof(time_t) == sizeof(long long))
uptime = std::chrono::seconds(strlist[0].toULongLong());

return true;
}

bool RemoteGetMemStats(int &totalMB, int &freeMB, int &totalVM, int &freeVM)
{
QStringList strlist(QString("QUERY_MEMSTATS"));

if (gCoreContext->SendReceiveStringList(strlist) && strlist.size() >= 4)
{
totalMB = strlist[0].toInt();
freeMB = strlist[1].toInt();
totalVM = strlist[2].toInt();
freeVM = strlist[3].toInt();
return true;
}

return false;
}

/**
* \brief Can we ping host within timeout seconds?
*
Expand Down
5 changes: 5 additions & 0 deletions mythtv/libs/libmythbase/mythmiscutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ MBASE_PUBLIC bool getMemStats(
using loadArray = std::array<double,3>;
MBASE_PUBLIC loadArray getLoadAvgs(void);

MBASE_PUBLIC bool RemoteGetLoad(loadArray &load);
MBASE_PUBLIC bool RemoteGetUptime(std::chrono::seconds &uptime);
MBASE_PUBLIC
bool RemoteGetMemStats(int &totalMB, int &freeMB, int &totalVM, int &freeVM);

MBASE_PUBLIC bool ping(const QString &host, std::chrono::milliseconds timeout);
MBASE_PUBLIC bool telnet(const QString &host, int port);

Expand Down
35 changes: 35 additions & 0 deletions mythtv/libs/libmythbase/remotefile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1455,4 +1455,39 @@ bool RemoteFile::Resume(bool repos)
return true;
}

static QString downloadRemoteFile(const QString &cmd, const QString &url,
const QString &storageGroup,
const QString &filename)
{
QStringList strlist(cmd);
strlist << url;
strlist << storageGroup;
strlist << filename;

bool ok = gCoreContext->SendReceiveStringList(strlist);

if (!ok || strlist.size() < 2 || strlist[0] != "OK")
{
LOG(VB_GENERAL, LOG_ERR,
"downloadRemoteFile(): " + cmd + " returned ERROR!");
return {};
}

return strlist[1];
}

QString RemoteDownloadFile(const QString &url,
const QString &storageGroup,
const QString &filename)
{
return downloadRemoteFile("DOWNLOAD_FILE", url, storageGroup, filename);
}

QString RemoteDownloadFileNow(const QString &url,
const QString &storageGroup,
const QString &filename)
{
return downloadRemoteFile("DOWNLOAD_FILE_NOW", url, storageGroup, filename);
}

/* vim: set expandtab tabstop=4 shiftwidth=4: */
7 changes: 7 additions & 0 deletions mythtv/libs/libmythbase/remotefile.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,11 @@ class MBASE_PUBLIC RemoteFile
ThreadedFileWriter *m_fileWriter {nullptr};
};

MBASE_PUBLIC QString RemoteDownloadFile(const QString &url,
const QString &storageGroup,
const QString &filename = "");
MBASE_PUBLIC QString RemoteDownloadFileNow(const QString &url,
const QString &storageGroup,
const QString &filename = "");

#endif
Loading
Loading
0