This repository has been archived by the owner on Nov 18, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
without implementation and with a new failing unit test.
- Loading branch information
Showing
11 changed files
with
276 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* This file is part of nzbget. See <http://nzbget.net>. | ||
* | ||
* Copyright (C) 2017 Andrey Prygunkov <hugbug@users.sourceforge.net> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* 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, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
|
||
#include "nzbget.h" | ||
#include "DirectUnpack.h" | ||
#include "Log.h" | ||
#include "Util.h" | ||
#include "FileSystem.h" | ||
#include "Options.h" | ||
|
||
void DirectUnpack::StartJob(NzbInfo* nzbInfo) | ||
{ | ||
DirectUnpack* directUnpack = new DirectUnpack(); | ||
directUnpack->m_nzbInfo = nzbInfo; | ||
directUnpack->SetAutoDestroy(false); | ||
|
||
nzbInfo->SetUnpackThread(directUnpack); | ||
nzbInfo->SetDirectUnpackStatus(NzbInfo::nsRunning); | ||
|
||
directUnpack->Start(); | ||
} | ||
|
||
void DirectUnpack::Run() | ||
{ | ||
{ | ||
GuardedDownloadQueue guard = DownloadQueue::Guard(); | ||
m_nzbInfo->SetUnpackThread(nullptr); | ||
m_nzbInfo->SetDirectUnpackStatus(NzbInfo::nsFailure); | ||
SetAutoDestroy(true); | ||
} | ||
} | ||
|
||
void DirectUnpack::Stop() | ||
{ | ||
debug("Stopping direct unpack"); | ||
Thread::Stop(); | ||
Terminate(); | ||
} | ||
|
||
void DirectUnpack::FileDownloaded(FileInfo* fileInfo) | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* This file is part of nzbget. See <http://nzbget.net>. | ||
* | ||
* Copyright (C) 2017 Andrey Prygunkov <hugbug@users.sourceforge.net> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* 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, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
|
||
#ifndef DIRECTUNPACK_H | ||
#define DIRECTUNPACK_H | ||
|
||
#include "Log.h" | ||
#include "Thread.h" | ||
#include "DownloadInfo.h" | ||
#include "Script.h" | ||
|
||
class DirectUnpack : public Thread, public ScriptController | ||
{ | ||
public: | ||
virtual void Run(); | ||
virtual void Stop(); | ||
static void StartJob(NzbInfo* nzbInfo); | ||
void FileDownloaded(FileInfo* fileInfo); | ||
|
||
private: | ||
NzbInfo* m_nzbInfo; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.