1
0
mirror of https://github.com/janeczku/calibre-web synced 2024-12-28 19:10:31 +00:00

Bugfix for showing series coatining only one book in list view containing having this book no series_index value set

This commit is contained in:
Ozzie Isaacs 2023-08-30 20:23:40 +02:00
parent fab35e69ec
commit 5509d4598b
2 changed files with 123 additions and 166 deletions

View File

@ -1014,7 +1014,7 @@ def series_list():
func.max(db.Books.series_index), db.Books.id)
.join(db.books_series_link).join(db.Series).filter(calibre_db.common_filters())
.group_by(text('books_series_link.series'))
.having(func.max(db.Books.series_index))
.having(or_(func.max(db.Books.series_index), db.Books.series_index==""))
.order_by(order)
.all())
return render_title_template('grid.html', entries=entries, folder='web.books_list', charlist=char_list,

View File

@ -37,20 +37,20 @@
<div class="row">
<div class="col-xs-6 col-md-6 col-sm-offset-3" style="margin-top:50px;">
<p class='text-justify attribute'><strong>Start Time: </strong>2023-08-28 19:42:24</p>
<p class='text-justify attribute'><strong>Start Time: </strong>2023-08-29 20:07:04</p>
</div>
</div>
<div class="row">
<div class="col-xs-6 col-md-6 col-sm-offset-3">
<p class='text-justify attribute'><strong>Stop Time: </strong>2023-08-29 02:13:03</p>
<p class='text-justify attribute'><strong>Stop Time: </strong>2023-08-30 02:37:10</p>
</div>
</div>
<div class="row">
<div class="col-xs-6 col-md-6 col-sm-offset-3">
<p class='text-justify attribute'><strong>Duration: </strong>5h 31 min</p>
<p class='text-justify attribute'><strong>Duration: </strong>5h 30 min</p>
</div>
</div>
</div>
@ -102,12 +102,12 @@
</tr>
<tr id="su" class="errorClass">
<tr id="su" class="passClass">
<td>TestAnonymous</td>
<td class="text-center">13</td>
<td class="text-center">12</td>
<td class="text-center">13</td>
<td class="text-center">0</td>
<td class="text-center">0</td>
<td class="text-center">1</td>
<td class="text-center">0</td>
<td class="text-center">
<a onclick="showClassDetail('c1', 13)">Detail</a>
@ -197,31 +197,11 @@
<tr id="et1.10" class="none bg-info">
<tr id='pt1.10' class='hiddenRow bg-success'>
<td>
<div class='testcase'>TestAnonymous - test_guest_change_visibility_series</div>
</td>
<td colspan='6'>
<div class="text-center">
<a class="popup_link text-center" onfocus='blur()' onclick="showTestDetail('div_et1.10')">ERROR</a>
</div>
<!--css div popup start-->
<div id="div_et1.10" class="popup_window test_output" style="display:block;">
<div class='close_button pull-right'>
<button type="button" class="close" aria-label="Close" onfocus="this.blur();"
onclick="document.getElementById('div_et1.10').style.display='none'"><span
aria-hidden="true">&times;</span></button>
</div>
<div class="text-left pull-left">
<pre class="text-left">Traceback (most recent call last):
File &#34;/home/ozzie/Development/calibre-web-test/test/test_anonymous.py&#34;, line 294, in test_guest_change_visibility_series
self.assertEqual(books[1][&#39;id&#39;], &#39;2&#39;)
IndexError: list index out of range</pre>
</div>
<div class="clearfix"></div>
</div>
<!--css div popup end-->
</td>
<td colspan='6' align='center'>PASS</td>
</tr>
@ -254,12 +234,12 @@ IndexError: list index out of range</pre>
<tr id="su" class="failClass">
<tr id="su" class="errorClass">
<td>TestBackupMetadata</td>
<td class="text-center">22</td>
<td class="text-center">21</td>
<td class="text-center">19</td>
<td class="text-center">1</td>
<td class="text-center">0</td>
<td class="text-center">2</td>
<td class="text-center">0</td>
<td class="text-center">
<a onclick="showClassDetail('c2', 22)">Detail</a>
@ -277,11 +257,42 @@ IndexError: list index out of range</pre>
<tr id='pt2.2' class='hiddenRow bg-success'>
<tr id="ft2.2" class="none bg-danger">
<td>
<div class='testcase'>TestBackupMetadata - test_backup_change_book_author</div>
</td>
<td colspan='6' align='center'>PASS</td>
<td colspan='6'>
<div class="text-center">
<a class="popup_link text-center" onfocus='blur()' onclick="showTestDetail('div_ft2.2')">FAIL</a>
</div>
<!--css div popup start-->
<div id="div_ft2.2" class="popup_window test_output" style="display:block;">
<div class='close_button pull-right'>
<button type="button" class="close" aria-label="Close" onfocus="this.blur();"
onclick="document.getElementById('div_ft2.2').style.display='none'"><span
aria-hidden="true">&times;</span></button>
</div>
<div class="text-left pull-left">
<pre class="text-left">Traceback (most recent call last):
File &#34;/home/ozzie/Development/calibre-web-test/test/test_backup_metadata.py&#34;, line 188, in test_backup_change_book_author
self.assertEqual([&#34;Hector Gonçalves&#34;], metadata[&#39;author&#39;])
AssertionError: Lists differ: [&#39;Hector Gonçalves&#39;] != [&#39;Frodo Beutlin&#39;, &#39;Norbert Halagal&#39;, &#39;Hector Gonçalves&#39;]
First differing element 0:
&#39;Hector Gonçalves&#39;
&#39;Frodo Beutlin&#39;
Second list contains 2 additional elements.
First extra element 1:
&#39;Norbert Halagal&#39;
- [&#39;Hector Gonçalves&#39;]
+ [&#39;Frodo Beutlin&#39;, &#39;Norbert Halagal&#39;, &#39;Hector Gonçalves&#39;]</pre>
</div>
<div class="clearfix"></div>
</div>
<!--css div popup end-->
</td>
</tr>
@ -313,35 +324,30 @@ IndexError: list index out of range</pre>
<tr id='pt2.6' class='hiddenRow bg-success'>
<tr id="et2.6" class="none bg-info">
<td>
<div class='testcase'>TestBackupMetadata - test_backup_change_book_publisher</div>
</td>
<td colspan='6' align='center'>PASS</td>
</tr>
<tr id="ft2.7" class="none bg-danger">
<td>
<div class='testcase'>TestBackupMetadata - test_backup_change_book_publishing_date</div>
</td>
<td colspan='6'>
<div class="text-center">
<a class="popup_link text-center" onfocus='blur()' onclick="showTestDetail('div_ft2.7')">FAIL</a>
<a class="popup_link text-center" onfocus='blur()' onclick="showTestDetail('div_et2.6')">ERROR</a>
</div>
<!--css div popup start-->
<div id="div_ft2.7" class="popup_window test_output" style="display:block;">
<div id="div_et2.6" class="popup_window test_output" style="display:block;">
<div class='close_button pull-right'>
<button type="button" class="close" aria-label="Close" onfocus="this.blur();"
onclick="document.getElementById('div_ft2.7').style.display='none'"><span
onclick="document.getElementById('div_et2.6').style.display='none'"><span
aria-hidden="true">&times;</span></button>
</div>
<div class="text-left pull-left">
<pre class="text-left">Traceback (most recent call last):
File &#34;/home/ozzie/Development/calibre-web-test/test/test_backup_metadata.py&#34;, line 205, in test_backup_change_book_publishing_date
self.assertEqual(metadata[&#39;pub_date&#39;].date(), date(2023, 6, 3))
AssertionError: datetime.date(101, 1, 1) != datetime.date(2023, 6, 3)</pre>
File &#34;/home/ozzie/Development/calibre-web-test/test/test_backup_metadata.py&#34;, line 143, in test_backup_change_book_publisher
metadata = read_opf_metadata(meta_path)
File &#34;/home/ozzie/Development/calibre-web-test/test/helper_func.py&#34;, line 579, in read_opf_metadata
with codecs.open(filename, &#34;r&#34;, &#34;utf-8&#34;) as f:
File &#34;/usr/lib/python3.10/codecs.py&#34;, line 906, in open
file = builtins.open(filename, mode, buffering)
FileNotFoundError: [Errno 2] No such file or directory: &#39;/home/ozzie/Development/Dokumente/tüst db/Frodo Beutlin/Der Buchtitel (1)/metadata.opf&#39;</pre>
</div>
<div class="clearfix"></div>
</div>
@ -351,6 +357,15 @@ AssertionError: datetime.date(101, 1, 1) != datetime.date(2023, 6, 3)</pre>
<tr id='pt2.7' class='hiddenRow bg-success'>
<td>
<div class='testcase'>TestBackupMetadata - test_backup_change_book_publishing_date</div>
</td>
<td colspan='6' align='center'>PASS</td>
</tr>
<tr id='pt2.8' class='hiddenRow bg-success'>
<td>
<div class='testcase'>TestBackupMetadata - test_backup_change_book_rating</div>
@ -360,11 +375,35 @@ AssertionError: datetime.date(101, 1, 1) != datetime.date(2023, 6, 3)</pre>
<tr id='pt2.9' class='hiddenRow bg-success'>
<tr id="et2.9" class="none bg-info">
<td>
<div class='testcase'>TestBackupMetadata - test_backup_change_book_seriesindex</div>
</td>
<td colspan='6' align='center'>PASS</td>
<td colspan='6'>
<div class="text-center">
<a class="popup_link text-center" onfocus='blur()' onclick="showTestDetail('div_et2.9')">ERROR</a>
</div>
<!--css div popup start-->
<div id="div_et2.9" class="popup_window test_output" style="display:block;">
<div class='close_button pull-right'>
<button type="button" class="close" aria-label="Close" onfocus="this.blur();"
onclick="document.getElementById('div_et2.9').style.display='none'"><span
aria-hidden="true">&times;</span></button>
</div>
<div class="text-left pull-left">
<pre class="text-left">Traceback (most recent call last):
File &#34;/home/ozzie/Development/calibre-web-test/test/test_backup_metadata.py&#34;, line 104, in test_backup_change_book_seriesindex
metadata = read_opf_metadata(meta_path)
File &#34;/home/ozzie/Development/calibre-web-test/test/helper_func.py&#34;, line 579, in read_opf_metadata
with codecs.open(filename, &#34;r&#34;, &#34;utf-8&#34;) as f:
File &#34;/usr/lib/python3.10/codecs.py&#34;, line 906, in open
file = builtins.open(filename, mode, buffering)
FileNotFoundError: [Errno 2] No such file or directory: &#39;/home/ozzie/Development/Dokumente/tüst db/Frodo Beutlin/Der Buchtitel (1)/metadata.opf&#39;</pre>
</div>
<div class="clearfix"></div>
</div>
<!--css div popup end-->
</td>
</tr>
@ -1954,9 +1993,9 @@ AttributeError: &#39;bool&#39; object has no attribute &#39;click&#39;</pre>
</div>
<div class="text-left pull-left">
<pre class="text-left">Traceback (most recent call last):
File &#34;/home/ozzie/Development/calibre-web-test/test/test_edit_books_list.py&#34;, line 184, in test_bookslist_edit_series
File &#34;/home/ozzie/Development/calibre-web-test/test/test_edit_books_list.py&#34;, line 185, in test_bookslist_edit_series
self.assertEqual(3, len(elements))
AssertionError: 3 != 2</pre>
AssertionError: 3 != 4</pre>
</div>
<div class="clearfix"></div>
</div>
@ -2012,12 +2051,12 @@ AssertionError: 3 != 2</pre>
<tr id="su" class="failClass">
<tr id="su" class="errorClass">
<td>TestLoadMetadata</td>
<td class="text-center">1</td>
<td class="text-center">0</td>
<td class="text-center">1</td>
<td class="text-center">0</td>
<td class="text-center">1</td>
<td class="text-center">0</td>
<td class="text-center">
<a onclick="showClassDetail('c17', 1)">Detail</a>
@ -2026,26 +2065,26 @@ AssertionError: 3 != 2</pre>
<tr id="ft17.1" class="none bg-danger">
<tr id="et17.1" class="none bg-info">
<td>
<div class='testcase'>TestLoadMetadata - test_load_metadata</div>
</td>
<td colspan='6'>
<div class="text-center">
<a class="popup_link text-center" onfocus='blur()' onclick="showTestDetail('div_ft17.1')">FAIL</a>
<a class="popup_link text-center" onfocus='blur()' onclick="showTestDetail('div_et17.1')">ERROR</a>
</div>
<!--css div popup start-->
<div id="div_ft17.1" class="popup_window test_output" style="display:block;">
<div id="div_et17.1" class="popup_window test_output" style="display:block;">
<div class='close_button pull-right'>
<button type="button" class="close" aria-label="Close" onfocus="this.blur();"
onclick="document.getElementById('div_ft17.1').style.display='none'"><span
onclick="document.getElementById('div_et17.1').style.display='none'"><span
aria-hidden="true">&times;</span></button>
</div>
<div class="text-left pull-left">
<pre class="text-left">Traceback (most recent call last):
File &#34;/home/ozzie/Development/calibre-web-test/test/test_edit_books_metadata.py&#34;, line 167, in test_load_metadata
self.assertGreaterEqual(diff(BytesIO(cover), BytesIO(original_cover), delete_diff_file=True), 0.05)
AssertionError: 0.0 not greater than or equal to 0.05</pre>
File &#34;/home/ozzie/Development/calibre-web-test/test/test_edit_books_metadata.py&#34;, line 63, in test_load_metadata
if &#39;https://comicvine.gamespot.com/&#39; == results[10][&#39;source&#39;]:
IndexError: list index out of range</pre>
</div>
<div class="clearfix"></div>
</div>
@ -2056,12 +2095,12 @@ AssertionError: 0.0 not greater than or equal to 0.05</pre>
<tr id="su" class="errorClass">
<tr id="su" class="passClass">
<td>TestEditBooksOnGdrive</td>
<td class="text-center">18</td>
<td class="text-center">17</td>
<td class="text-center">18</td>
<td class="text-center">0</td>
<td class="text-center">0</td>
<td class="text-center">1</td>
<td class="text-center">0</td>
<td class="text-center">
<a onclick="showClassDetail('c18', 18)">Detail</a>
@ -2205,31 +2244,11 @@ AssertionError: 0.0 not greater than or equal to 0.05</pre>
<tr id="et18.16" class="none bg-info">
<tr id='pt18.16' class='hiddenRow bg-success'>
<td>
<div class='testcase'>TestEditBooksOnGdrive - test_edit_title</div>
</td>
<td colspan='6'>
<div class="text-center">
<a class="popup_link text-center" onfocus='blur()' onclick="showTestDetail('div_et18.16')">ERROR</a>
</div>
<!--css div popup start-->
<div id="div_et18.16" class="popup_window test_output" style="display:block;">
<div class='close_button pull-right'>
<button type="button" class="close" aria-label="Close" onfocus="this.blur();"
onclick="document.getElementById('div_et18.16').style.display='none'"><span
aria-hidden="true">&times;</span></button>
</div>
<div class="text-left pull-left">
<pre class="text-left">Traceback (most recent call last):
File &#34;/home/ozzie/Development/calibre-web-test/test/test_edit_ebooks_gdrive.py&#34;, line 173, in test_edit_title
self.assertEqual(&#39;Unknown&#39;, values[&#39;title&#39;])
KeyError: &#39;title&#39;</pre>
</div>
<div class="clearfix"></div>
</div>
<!--css div popup end-->
</td>
<td colspan='6' align='center'>PASS</td>
</tr>
@ -3637,12 +3656,12 @@ KeyError: &#39;title&#39;</pre>
<tr id="su" class="errorClass">
<td>_FailedTest</td>
<tr id="su" class="passClass">
<td>TestUploadPDF</td>
<td class="text-center">1</td>
<td class="text-center">1</td>
<td class="text-center">0</td>
<td class="text-center">0</td>
<td class="text-center">1</td>
<td class="text-center">0</td>
<td class="text-center">
<a onclick="showClassDetail('c37', 1)">Detail</a>
@ -3651,37 +3670,11 @@ KeyError: &#39;title&#39;</pre>
<tr id="et37.1" class="none bg-info">
<tr id='pt37.1' class='hiddenRow bg-success'>
<td>
<div class='testcase'>_FailedTest - test_pdf_metadata</div>
</td>
<td colspan='6'>
<div class="text-center">
<a class="popup_link text-center" onfocus='blur()' onclick="showTestDetail('div_et37.1')">ERROR</a>
</div>
<!--css div popup start-->
<div id="div_et37.1" class="popup_window test_output" style="display:block;">
<div class='close_button pull-right'>
<button type="button" class="close" aria-label="Close" onfocus="this.blur();"
onclick="document.getElementById('div_et37.1').style.display='none'"><span
aria-hidden="true">&times;</span></button>
</div>
<div class="text-left pull-left">
<pre class="text-left">ImportError: Failed to import test module: test_pdf_metadata
Traceback (most recent call last):
File &#34;/usr/lib/python3.10/unittest/loader.py&#34;, line 436, in _find_test_path
module = self._get_module_from_name(name)
File &#34;/usr/lib/python3.10/unittest/loader.py&#34;, line 377, in _get_module_from_name
__import__(name)
File &#34;/home/ozzie/Development/calibre-web-test/test/test_pdf_metadata.py&#34;, line 261
)&#39;&#39;&#39;
^
SyntaxError: unterminated triple-quoted string literal (detected at line 270)</pre>
</div>
<div class="clearfix"></div>
</div>
<!--css div popup end-->
<div class='testcase'>TestUploadPDF - test_upload_invalid_pdf</div>
</td>
<td colspan='6' align='center'>PASS</td>
</tr>
@ -3729,12 +3722,12 @@ SyntaxError: unterminated triple-quoted string literal (detected at line 270)</p
<tr id="su" class="errorClass">
<tr id="su" class="passClass">
<td>TestReader</td>
<td class="text-center">6</td>
<td class="text-center">5</td>
<td class="text-center">6</td>
<td class="text-center">0</td>
<td class="text-center">0</td>
<td class="text-center">1</td>
<td class="text-center">0</td>
<td class="text-center">
<a onclick="showClassDetail('c39', 6)">Detail</a>
@ -3743,47 +3736,11 @@ SyntaxError: unterminated triple-quoted string literal (detected at line 270)</p
<tr id="et39.1" class="none bg-info">
<tr id='pt39.1' class='hiddenRow bg-success'>
<td>
<div class='testcase'>TestReader - test_comic_MACOS_files</div>
</td>
<td colspan='6'>
<div class="text-center">
<a class="popup_link text-center" onfocus='blur()' onclick="showTestDetail('div_et39.1')">ERROR</a>
</div>
<!--css div popup start-->
<div id="div_et39.1" class="popup_window test_output" style="display:block;">
<div class='close_button pull-right'>
<button type="button" class="close" aria-label="Close" onfocus="this.blur();"
onclick="document.getElementById('div_et39.1').style.display='none'"><span
aria-hidden="true">&times;</span></button>
</div>
<div class="text-left pull-left">
<pre class="text-left">Traceback (most recent call last):
File &#34;/home/ozzie/Development/calibre-web-test/test/test_reader.py&#34;, line 218, in test_comic_MACOS_files
left.click()
File &#34;/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/selenium/webdriver/remote/webelement.py&#34;, line 93, in click
self._execute(Command.CLICK_ELEMENT)
File &#34;/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/selenium/webdriver/remote/webelement.py&#34;, line 403, in _execute
return self._parent.execute(command, params)
File &#34;/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py&#34;, line 440, in execute
self.error_handler.check_response(response)
File &#34;/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/selenium/webdriver/remote/errorhandler.py&#34;, line 245, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementNotInteractableException: Message: Element &lt;div id=&#34;left&#34; class=&#34;arrow&#34;&gt; could not be scrolled into view
Stacktrace:
RemoteError@chrome://remote/content/shared/RemoteError.sys.mjs:8:8
WebDriverError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:187:5
ElementNotInteractableError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:347:5
webdriverClickElement@chrome://remote/content/marionette/interaction.sys.mjs:152:11
interaction.clickElement@chrome://remote/content/marionette/interaction.sys.mjs:121:11
clickElement@chrome://remote/content/marionette/actors/MarionetteCommandsChild.sys.mjs:204:29
receiveMessage@chrome://remote/content/marionette/actors/MarionetteCommandsChild.sys.mjs:86:31</pre>
</div>
<div class="clearfix"></div>
</div>
<!--css div popup end-->
</td>
<td colspan='6' align='center'>PASS</td>
</tr>
@ -5343,9 +5300,9 @@ receiveMessage@chrome://remote/content/marionette/actors/MarionetteCommandsChild
<tr id='total_row' class="text-center bg-grey">
<td>Total</td>
<td>462</td>
<td>445</td>
<td>3</td>
<td>5</td>
<td>447</td>
<td>2</td>
<td>4</td>
<td>9</td>
<td>&nbsp;</td>
</tr>
@ -5374,7 +5331,7 @@ receiveMessage@chrome://remote/content/marionette/actors/MarionetteCommandsChild
<tr>
<th>Platform</th>
<td>Linux 6.2.0-26-generic #26~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Jul 13 16:27:29 UTC 2 x86_64 x86_64</td>
<td>Linux 6.2.0-31-generic #31~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Aug 16 13:45:26 UTC 2 x86_64 x86_64</td>
<td>Basic</td>
</tr>
@ -5836,7 +5793,7 @@ receiveMessage@chrome://remote/content/marionette/actors/MarionetteCommandsChild
</div>
<script>
drawCircle(445, 3, 5, 9);
drawCircle(447, 2, 4, 9);
showCase(5);
</script>