Files
purchases-ios/Sources/Logging/Strings/FileRepositoryStrings.swift
T
Jacob Rakidzich 04bc10266b Finalize video component to include a checksum, dark mode support, and optimize memory usage for large file downloads (#5631)
* Checksum and tests

* add checksum to video component models

* Update cache warming

* put the checksum in the right spot and update the view model

* File repo updates

* add missing assertion

* revert accidental trailiing comma

* Checksum from file

* Ensure cache invalidates when the checksum changes

* Use checksum as filename if available

* greedily fill space while loading occurs

* update remote image usage of the repository

* Reduce memory footprint of large file downloads by streaming the download to a temp file

* Update keyed deferred value storage key to include checksum

* remove unused argument

* remove wip comment

* Get tests to compile

* Write tests for the large item cache type

* remove test from the file repository suite

* trailing commas

* remove cache warming of videos

* remove un-needed change causing existential types

* delete the temporary file after success or failure of the code block

* log with the checksums

* optimize checksum generation to occur at the same time as the temp file storage

* starting to work on border gradients,

* Revert "starting to work on border gradients,"

This reverts commit 429e6d2fab.

* clarity regarding dark mode urls
2025-10-14 08:05:01 -05:00

41 lines
1.3 KiB
Swift

//
// Copyright RevenueCat Inc. All Rights Reserved.
//
// Licensed under the MIT License (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://opensource.org/licenses/MIT
//
// FileRepositoryStrings.swift
//
// Created by Jacob Zivan Rakidzich on 8/14/25.
import Foundation
enum FileRepositoryStrings {
case failedToSaveCachedFile(URL, Error)
case failedToFetchFileFromRemoteSource(URL, Error)
case failedToCreateCacheDirectory(URL)
case failedToCreateTemporaryFile(URL)
}
extension FileRepositoryStrings: LogMessage {
var description: String {
switch self {
case .failedToSaveCachedFile(let url, let error):
return "Failed to save file to \(url.absoluteString): \(error)"
case .failedToFetchFileFromRemoteSource(let url, let error):
return "Failed to download file from \(url.absoluteString): \(error)"
case .failedToCreateCacheDirectory(let url):
return "Failed to create cache directory for \(url.absoluteString)"
case .failedToCreateTemporaryFile(let url):
return "Failed to create a temporary file for \(url.absoluteString)"
}
}
var category: String { return "file_repository" }
}