Skip to content

Commit

Permalink
修复 删除指定缓存未生效的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
changsanjiang committed Dec 9, 2024
1 parent 0ef56ac commit 222de4f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion SJMediaCacheServer.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'SJMediaCacheServer'
s.version = '2.0.5'
s.version = '2.0.6'
s.summary = <<-DESC
SJMediaCacheServer 是一个高效的 HTTP 媒体缓存框架,旨在代理媒体数据请求并优先提供缓存数据,从而减少网络流量并增强播放的流畅性。该框架支持两种类型的远程资源:基于文件的媒体,如 MP3、AAC、WAV、FLAC、OGG、MP4 和 MOV 等常见格式,以及 HLS(HTTP Live Streaming)流。它会自动解析 HLS 播放列表并代理各个媒体片段。
DESC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ - (void)removeSegment:(HLSAssetSegment *)content {

- (void)clear {
[NSFileManager.defaultManager removeItemAtPath:mRootDir error:NULL];
mDirCreated = NO;
}

#pragma mark - mark
Expand Down
4 changes: 2 additions & 2 deletions SJMediaCacheServer/Core/Cache/MCSCacheManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,9 @@ - (BOOL)_isProtectedForCacheWithAsset:(id<MCSAsset>)asset {
return [_sqlite3 objectsForClass:MCSProtectedCacheItem.class conditions:@[
[SJSQLite3Condition conditionWithColumn:@"assetType" value:@(asset.type)],
[SJSQLite3Condition conditionWithColumn:@"asset" value:@(asset.id)]
] orderBy:nil error:NULL].count == 0;
] orderBy:nil error:NULL].count != 0;
}

- (void)_removeAssetsForLimit:(MCSLimit)limit {
NSInteger count = MCSAssetManager.shared.countOfAllAssets - _countOfProtectedAssets;

Expand Down

0 comments on commit 222de4f

Please sign in to comment.