mirror of
https://github.com/hkalexling/Mango.git
synced 2025-08-02 19:05:32 -04:00
Remove unnecessary path
method
This commit is contained in:
parent
e6dbeb623b
commit
5b23a112b2
@ -9,6 +9,7 @@ class ArchiveEntry < Entry
|
||||
|
||||
def initialize(@zip_path, @book)
|
||||
storage = Storage.default
|
||||
@path = @zip_path
|
||||
@encoded_path = URI.encode @zip_path
|
||||
@title = File.basename @zip_path, File.extname @zip_path
|
||||
@encoded_title = URI.encode @title
|
||||
@ -48,10 +49,6 @@ class ArchiveEntry < Entry
|
||||
file.close
|
||||
end
|
||||
|
||||
def path : String
|
||||
@zip_path
|
||||
end
|
||||
|
||||
private def sorted_archive_entries
|
||||
ArchiveFile.open @zip_path do |file|
|
||||
entries = file.entries
|
||||
|
@ -14,6 +14,7 @@ class DirEntry < Entry
|
||||
|
||||
def initialize(@dir_path, @book)
|
||||
storage = Storage.default
|
||||
@path = @dir_path
|
||||
@encoded_path = URI.encode @dir_path
|
||||
@title = File.basename @dir_path
|
||||
@encoded_title = URI.encode @title
|
||||
@ -56,10 +57,6 @@ class DirEntry < Entry
|
||||
@pages = sorted_files.size
|
||||
end
|
||||
|
||||
def path : String
|
||||
@dir_path
|
||||
end
|
||||
|
||||
def read_page(page_num)
|
||||
img = nil
|
||||
begin
|
||||
|
@ -1,12 +1,12 @@
|
||||
require "image_size"
|
||||
|
||||
abstract class Entry
|
||||
getter id : String, book : Title, title : String,
|
||||
getter id : String, book : Title, title : String, path : String,
|
||||
size : String, pages : Int32, mtime : Time,
|
||||
encoded_path : String, encoded_title : String, err_msg : String?
|
||||
|
||||
def initialize(
|
||||
@id, @title, @book,
|
||||
@id, @title, @book, @path,
|
||||
@size, @pages, @mtime,
|
||||
@encoded_path, @encoded_title, @err_msg
|
||||
)
|
||||
@ -229,8 +229,6 @@ abstract class Entry
|
||||
extend ClassMethods
|
||||
end
|
||||
|
||||
abstract def path : String
|
||||
|
||||
abstract def read_page(page_num)
|
||||
|
||||
abstract def page_dimensions
|
||||
|
Loading…
x
Reference in New Issue
Block a user