From 3c707d39ec2858593a5c53fab22bd9f6ebd6bd89 Mon Sep 17 00:00:00 2001 From: Alexander Olofsson Date: Tue, 17 Sep 2024 19:28:56 +0200 Subject: [PATCH] Improve CLI story handling slightly --- lib/fic_tracker/cli/story.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/fic_tracker/cli/story.rb b/lib/fic_tracker/cli/story.rb index bfe507f..51fc9fb 100644 --- a/lib/fic_tracker/cli/story.rb +++ b/lib/fic_tracker/cli/story.rb @@ -52,7 +52,7 @@ class FicTracker::Cli::Story < Thor }.compact found = FicTracker::Models::Story.where(**search) - if found.size > 1 && !story.start_with?('*/') + if found.count > 1 && !story.start_with?('*/') puts "Found multiple potential stories for #{story}, please specify which ones to remove using the syntax /: (use */ to remove all)" found.each do |f| puts " - #{f.backend_name}/#{f.slug} - #{f}" @@ -69,9 +69,9 @@ class FicTracker::Cli::Story < Thor desc 'list', 'List all tracked stories' def list setup! - info = [['Story', 'Chapters', 'Completed', 'Last Updated'], ['-----','--------','---------','------------']] + info = [['Slug', 'Story', 'Chapters', 'Completed', 'Last Updated'], ['----','-----','--------','---------','------------']] FicTracker::Models::Story.order_by(:name).each do |story| - info << [story.name, story.chapters.size, story.completed?, (story.updated_at || story.published_at).strftime("%F")] + info << [story.slug, story.name, story.chapters.size, story.completed?, (story.updated_at || story.published_at).strftime("%F")] end print_table info end