plugin-jm-server 0.1.13__tar.gz → 0.1.14__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: plugin_jm_server
3
- Version: 0.1.13
3
+ Version: 0.1.14
4
4
  Summary: plugin_jm_server, a plugin for jmcomic that can be used to view comics in a web browser.
5
5
  Home-page: https://github.com/hect0x7/plugin-jm-server
6
6
  Author: hect0x7
@@ -0,0 +1,3 @@
1
+ __version__ = '0.1.14'
2
+
3
+ from .app import *
@@ -22,12 +22,18 @@ class FileManager:
22
22
  def get_jm_view_images(self, path):
23
23
  images_data = []
24
24
 
25
+ give_up_sort = False
26
+
25
27
  for f in self.files_of_dir_safe(path):
26
28
  if not self.is_image_file(f):
27
29
  continue
28
30
  f = quote(f)
29
31
  name = common.of_file_name(f)
30
- index = int(name[:name.index('.')])
32
+ try:
33
+ index = int(name[:name.index('.')])
34
+ except ValueError:
35
+ give_up_sort = True
36
+ index = None
31
37
 
32
38
  images_data.append({
33
39
  'filename': name,
@@ -35,7 +41,8 @@ class FileManager:
35
41
  'index': index,
36
42
  })
37
43
 
38
- images_data.sort(key=lambda item: item['index'])
44
+ if give_up_sort is False:
45
+ images_data.sort(key=lambda item: item['index'])
39
46
 
40
47
  return images_data
41
48
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: plugin_jm_server
3
- Version: 0.1.13
3
+ Version: 0.1.14
4
4
  Summary: plugin_jm_server, a plugin for jmcomic that can be used to view comics in a web browser.
5
5
  Home-page: https://github.com/hect0x7/plugin-jm-server
6
6
  Author: hect0x7
@@ -1,3 +0,0 @@
1
- __version__ = '0.1.13'
2
-
3
- from .app import *