mirror of
https://github.com/neon443/StickerSlack.git
synced 2026-11-30 12:44:51 +00:00
fixed some gifs not being loaded as downloaded
-added UIName to separate the gif's slug and title fixed downloading gifs into emoji container
This commit is contained in:
10 files changed
+42
-14
No files matched your search
@@ -10,10 +10,18 @@ import Messages
|
||||
|
||||
extension StickerProtocol {
|
||||
var localImageURLString: String {
|
||||
let containerPath: String
|
||||
if type(of: self) == Emoji.self {
|
||||
containerPath = EmojiHoarder.container.path()
|
||||
} else if type(of: self) == Gif.self {
|
||||
containerPath = GifHoarder.container.path()
|
||||
} else {
|
||||
fatalError("sticker type unrecogniesd")
|
||||
}
|
||||
let urlString = remoteImageURL.absoluteString
|
||||
let split = urlString.split(separator: ".")
|
||||
let fileExtension = ".\(split.last ?? "png")"
|
||||
return EmojiHoarder.container.path()+name+"."+id+fileExtension
|
||||
let fileExtension = ".\(split.last!)"
|
||||
return containerPath+name+"."+id+fileExtension
|
||||
}
|
||||
|
||||
var localImageURL: URL {
|
||||
|
||||
@@ -11,6 +11,7 @@ import Messages
|
||||
protocol StickerProtocol: Codable, Identifiable, Hashable {
|
||||
var id: String { get set }
|
||||
var name: String { get set }
|
||||
var UIName: String { get set }
|
||||
|
||||
var typeGlyph: String { get }
|
||||
|
||||
|
||||