mirror of
				https://github.com/YACReader/yacreader
				synced 2025-11-03 16:54:39 -05:00 
			
		
		
		
	Include the hashes of the prev/next comics in the comic info when opening a comic in the server
This commit is contained in:
		@ -105,10 +105,16 @@ void ComicControllerV2::service(HttpRequest &request, HttpResponse &response)
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            if (found) {
 | 
			
		||||
                if (i > 0)
 | 
			
		||||
                    response.write(QString("previousComic:%1\r\n").arg(siblings.at(i - 1)->id).toUtf8());
 | 
			
		||||
                if (i < siblings.length() - 1)
 | 
			
		||||
                    response.write(QString("nextComic:%1\r\n").arg(siblings.at(i + 1)->id).toUtf8());
 | 
			
		||||
                if (i > 0) {
 | 
			
		||||
                    ComicDB *previousComic = static_cast<ComicDB *>(siblings.at(i - 1));
 | 
			
		||||
                    response.write(QString("previousComic:%1\r\n").arg(previousComic->id).toUtf8());
 | 
			
		||||
                    response.write(QString("previousComicHash:%1\r\n").arg(previousComic->info.hash).toUtf8());
 | 
			
		||||
                }
 | 
			
		||||
                if (i < siblings.length() - 1) {
 | 
			
		||||
                    ComicDB *nextComic = static_cast<ComicDB *>(siblings.at(i + 1));
 | 
			
		||||
                    response.write(QString("nextComic:%1\r\n").arg(nextComic->id).toUtf8());
 | 
			
		||||
                    response.write(QString("nextComicHash:%1\r\n").arg(nextComic->info.hash).toUtf8());
 | 
			
		||||
                }
 | 
			
		||||
            } else {
 | 
			
		||||
                //ERROR
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
@ -83,10 +83,16 @@ void ComicControllerInReadingListV2::service(HttpRequest &request, HttpResponse
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        if (found) {
 | 
			
		||||
            if (i > 0)
 | 
			
		||||
                response.write(QString("previousComic:%1\r\n").arg(siblings.at(i - 1).id).toUtf8());
 | 
			
		||||
            if (i < siblings.length() - 1)
 | 
			
		||||
                response.write(QString("nextComic:%1\r\n").arg(siblings.at(i + 1).id).toUtf8());
 | 
			
		||||
            if (i > 0) {
 | 
			
		||||
                ComicDB previousComic = siblings.at(i - 1);
 | 
			
		||||
                response.write(QString("previousComic:%1\r\n").arg(previousComic.id).toUtf8());
 | 
			
		||||
                response.write(QString("previousComicHash:%1\r\n").arg(previousComic.info.hash).toUtf8());
 | 
			
		||||
            }
 | 
			
		||||
            if (i < siblings.length() - 1) {
 | 
			
		||||
                ComicDB nextComic = siblings.at(i + 1);
 | 
			
		||||
                response.write(QString("nextComic:%1\r\n").arg(nextComic.id).toUtf8());
 | 
			
		||||
                response.write(QString("nextComicHash:%1\r\n").arg(nextComic.info.hash).toUtf8());
 | 
			
		||||
            }
 | 
			
		||||
        } else {
 | 
			
		||||
            //ERROR
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user