diff -Nru nzb-0.1.8/ChangeLog nzb-0.1.9/ChangeLog --- nzb-0.1.8/ChangeLog 2009-04-11 15:22:39.000000000 +0100 +++ nzb-0.1.9/ChangeLog 2009-06-06 18:51:41.000000000 +0100 @@ -1,3 +1,8 @@ +0.1.9: + + - Try to output data even if file is broken. + - Fixed out of order segments causing file corruption bug (#2800317). + 0.1.8: - Detect RAR file only based on content, not name, when streaming. diff -Nru /tmp/KkkHV9XR5N/nzb-0.1.8/debian/changelog /tmp/IN5ih1A6yc/nzb-0.1.9/debian/changelog --- nzb-0.1.8/debian/changelog 2009-06-12 14:00:33.000000000 +0100 +++ nzb-0.1.9/debian/changelog 2009-06-12 14:00:33.000000000 +0100 @@ -1,10 +1,9 @@ -nzb (0.1.8-1ubuntu1) karmic; urgency=low +nzb (0.1.9-1) unstable; urgency=low - * Merge from debian unstable, remaining changes: (LP: #373017) - - debian/rules, debian/nzb.desktop, debian/nzb.xpm - - provide a desktop file and icon + * New upstream release. + * Included Debian menu integration patch (closes: #527374) - -- Andreas Moog Thu, 07 May 2009 01:19:07 +0200 + -- Mattias Nordstrom Mon, 08 Jun 2009 15:51:38 +0300 nzb (0.1.8-1) unstable; urgency=low @@ -17,14 +16,6 @@ -- Mattias Nordstrom Sat, 11 Apr 2009 17:28:30 +0300 -nzb (0.1.7-1ubuntu1) gutsy; urgency=low - - * Provided a .desktop file (LP: #111134) - * debian/control: - - updated maintainer field - - -- Mario Bonino Tue, 25 Sep 2007 21:04:25 +0200 - nzb (0.1.7-1) unstable; urgency=low * New upstream release. @@ -85,4 +76,3 @@ * Initial Release. -- Mattias Nordstrom Sun, 21 Aug 2005 19:22:16 +0300 - diff -Nru /tmp/KkkHV9XR5N/nzb-0.1.8/debian/control /tmp/IN5ih1A6yc/nzb-0.1.9/debian/control --- nzb-0.1.8/debian/control 2009-06-12 14:00:33.000000000 +0100 +++ nzb-0.1.9/debian/control 2009-06-12 14:00:33.000000000 +0100 @@ -1,8 +1,7 @@ Source: nzb Section: net Priority: optional -Maintainer: Ubuntu MOTU Developers -XSBC-Original-Maintainer: Mattias Nordstrom +Maintainer: Mattias Nordstrom Build-Depends: debhelper (>= 5.0.0), autotools-dev, docbook-to-man, libqt4-dev, qt4-dev-tools Standards-Version: 3.8.1.0 Homepage: http://nzb.sourceforge.net/ diff -Nru /tmp/KkkHV9XR5N/nzb-0.1.8/src/nzbdata.cpp /tmp/IN5ih1A6yc/nzb-0.1.9/src/nzbdata.cpp --- nzb-0.1.8/src/nzbdata.cpp 2006-10-08 18:30:42.000000000 +0100 +++ nzb-0.1.9/src/nzbdata.cpp 2009-06-06 18:51:41.000000000 +0100 @@ -131,8 +131,10 @@ epoch.setTime_t((attributes.value("date")).toInt()); NzbFile newfile(attributes.value("poster"), epoch, attributes.value("subject")); currentFile = newfile; + fileSegs.clear(); } else if (qName == "segment") { currentBytes = attributes.value("bytes").toInt(); + currentSegPos = attributes.value("number").toInt(); } currentText.clear(); @@ -145,9 +147,13 @@ currentFile.addGroup(currentText); } else if (qName == "segment") { NzbSeg newseg(currentBytes, "<"+currentText+">"); - currentFile.addSegment(newseg); + //currentFile.addSegment(newseg, currentSegPos); + fileSegs[currentSegPos] = newseg; currentFile.setNzbFileName(nzbFileName); } else if (qName == "file") { + for (int i = 1; i <= fileSegs.size(); i++) { + currentFile.addSegment(fileSegs.value(i)); + } parent->addFile(currentFile); } diff -Nru /tmp/KkkHV9XR5N/nzb-0.1.8/src/nzbdata.h /tmp/IN5ih1A6yc/nzb-0.1.9/src/nzbdata.h --- nzb-0.1.8/src/nzbdata.h 2009-04-10 21:12:01.000000000 +0100 +++ nzb-0.1.9/src/nzbdata.h 2009-06-06 18:51:41.000000000 +0100 @@ -32,7 +32,7 @@ #include #include -#define NZB_VERSION "0.1.8" +#define NZB_VERSION "0.1.9" #define NZB_UNDEF 0 @@ -65,6 +65,7 @@ { public: NzbSeg(int bytes, QString msgid); + NzbSeg() { } int getBytes() const { return bytes; } QString getMsgid() const { return msgid; } QString* getData() { return &data; } @@ -173,7 +174,8 @@ QString nzbFileName; QString currentText; NzbFile currentFile; - int currentBytes; + QMap fileSegs; + int currentBytes, currentSegPos; QString errorStr; bool metNzbTag; NzbList *parent; diff -Nru /tmp/KkkHV9XR5N/nzb-0.1.8/src/output.cpp /tmp/IN5ih1A6yc/nzb-0.1.9/src/output.cpp --- nzb-0.1.8/src/output.cpp 2009-04-11 00:03:44.000000000 +0100 +++ nzb-0.1.9/src/output.cpp 2009-06-06 18:51:41.000000000 +0100 @@ -51,6 +51,8 @@ player = NULL; fout = NULL; first_output = true; + last_file = -1; + fn = ""; this->exec(); @@ -143,8 +145,9 @@ } if (!stream) { - if (seg == 0) { - QString fn = ((MainWindow*)parent)->getConfig()->value("output/savepath").toString(); + if (last_file != file) { + last_file = file; + fn = ((MainWindow*)parent)->getConfig()->value("output/savepath").toString(); if (fn.isEmpty()) { emit outputEvent("Please specify a save path under the output tab in options.", 2); return; @@ -226,10 +229,36 @@ } } } - fn += nzblist->getFile(file)->getSegment(seg)->getFilename(); + + /*for (int i = 0; i < nzblist->getFile(file)->getSegments()->size(); i++) { + if (nzblist->getFile(file)->getSegments()->at(i).getFilename() != "") { + fn += nzblist->getFile(file)->getSegments()->at(i).getFilename(); + qDebug() << "Opening " << fn; + break; + } + }*/ + //fn += nzblist->getFile(file)->getSegment(seg)->getFilename(); + + fout = NULL; - fout = new QFile(fn); - fout->open(QIODevice::WriteOnly); + /*fout = new QFile(fn); + fout->open(QIODevice::WriteOnly);*/ + } + + if (fn.right(1) == "/") { + fn += nzblist->getFile(file)->getSegment(seg)->getFilename(); + /*if (fn.right(1) == "/") { Filename guessing based on subject. + QRegExp rx("* (1addslashhere*)"); + rx.setPatternSyntax(QRegExp::Wildcard); + if (rx.exactMatch(nzblist->getFile(file)->getSubject().right(11))) { + qDebug() << "Guessing filename..."; + int pos = nzblist->getFile(file)->getSubject().lastIndexOf(" "); + int pos2 = nzblist->getFile(file)->getSubject().lastIndexOf(" ", pos-2); + fn += nzblist->getFile(file)->getSubject().mid(pos2+1, pos-(pos2+1)); + } + }*/ + fout = new QFile(fn); + fout->open(QIODevice::WriteOnly); } if (fout != NULL && fout->error() == QFile::NoError) { diff -Nru /tmp/KkkHV9XR5N/nzb-0.1.8/src/output.h /tmp/IN5ih1A6yc/nzb-0.1.9/src/output.h --- nzb-0.1.8/src/output.h 2009-04-11 00:03:44.000000000 +0100 +++ nzb-0.1.9/src/output.h 2009-06-06 18:51:41.000000000 +0100 @@ -64,7 +64,8 @@ NzbList *nzblist; int thread_id; QMutex *file_lock; - int file, seg; + int file, seg, last_file; + QString fn; QTcpServer *streamer; QTcpSocket *ms;