From 7a21f4dc9b33200182268e075f094b68bbafdd82 Mon Sep 17 00:00:00 2001 From: Alex Ling Date: Sat, 22 Feb 2020 18:15:40 +0000 Subject: [PATCH] Sort titles in library by name by default --- src/library.cr | 1 + 1 file changed, 1 insertion(+) diff --git a/src/library.cr b/src/library.cr index eda954a..5b72dc7 100644 --- a/src/library.cr +++ b/src/library.cr @@ -180,6 +180,7 @@ class Library .select { |path| File.directory? File.join @dir, path } .map { |path| Title.new File.join(@dir, path), @storage } .select { |title| !title.entries.empty? } + .sort { |a, b| a.title <=> b.title } @logger.debug "Scan completed" @logger.debug "Scanned library: \n#{self.to_pretty_json}" end