diff --git a/ajax/getfoldercontents.php b/ajax/getfoldercontents.php
index d2dde62..ba29a90 100644
--- a/ajax/getfoldercontents.php
+++ b/ajax/getfoldercontents.php
@@ -77,10 +77,20 @@ foreach ( $entries as $entry ) {
$folders[] = $info;
} else {
if ( (substr($entry, -3) == "cbz") || (substr($entry, -3) == "cbr") ) {
- $info["comname"] = substr(((strpos($entry, " - ") !== false) ? str_replace(" - ", "
", $entry) : $entry), 0, -4);
+ $withoutext = substr($entry, 0, -4);
+ if ( strlen($withoutext) <= ISSUELENGTHCUTOFF ) {
+ $info["comname"] = str_replace(" - ", "
", $withoutext);
+ } else {
+ if ( strpos($withoutext, " - ") !== false ) {
+ $info["comname"] = substr($withoutext, strpos($withoutext, " - ") + 3);
+ } else {
+ $info["comname"] = $withoutext;
+ }
+ }
+ //$info["comname"] = substr(((strpos($entry, " - ") !== false) ? str_replace(" - ", "
", $entry) : $entry), 0, -4);
$info["relcomic"] = base64_encode($compath . (($compath == "/") ? "" : "/") . $entry);
$info["mtime"] = filemtime($fullcompath . $entry);
- $info["thumburl"] = THUMBSDIR . $compath . (($compath == "/") ? "" : "/") . substr($entry, 0, -4) . ".jpg";
+ $info["thumburl"] = THUMBSDIR . $compath . (($compath == "/") ? "" : "/") . $withoutext . ".jpg";
if ( in_array($entry, $issues_read) ) {
$info["read"] = true;
$readclass = " readborder";
diff --git a/config-dist.php b/config-dist.php
index 3bea0fd..0fcd0c0 100644
--- a/config-dist.php
+++ b/config-dist.php
@@ -29,6 +29,12 @@ define('EXTRACTSDIR', 'comics');
//
define('ADULTMODE', false);
+//
+// The character count in the comic title where, when exceeded
+// the folder/comic/series name will be removed for readability.
+//
+define('ISSUELENGTHCUTOFF', 25);
+
//
// Database information for tracking last read page
//