Skip to content

Commit ec2b0d3

Browse files
committed
Clear command caches on new file import
1 parent e4ac354 commit ec2b0d3

File tree

4 files changed

+19
-0
lines changed

4 files changed

+19
-0
lines changed

ff-utils-winforms/Media/GetFrameCountCached.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,10 @@ private static int GetFromCache(QueryInfo hash)
5858

5959
return 0;
6060
}
61+
62+
public static void ClearCache()
63+
{
64+
cache.Clear();
65+
}
6166
}
6267
}

ff-utils-winforms/Media/GetMediaResolutionCached.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,10 @@ private static Size GetFromCache(QueryInfo hash)
5252

5353
return new Size();
5454
}
55+
56+
public static void ClearCache ()
57+
{
58+
cache.Clear();
59+
}
5560
}
5661
}

ff-utils-winforms/Media/GetVideoInfo.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,5 +126,10 @@ private static string GetFromCache(QueryInfo hash, ref Dictionary<QueryInfo, str
126126

127127
return "";
128128
}
129+
130+
public static void ClearCache ()
131+
{
132+
cmdCache.Clear();
133+
}
129134
}
130135
}

ff-utils-winforms/UI/FileList.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ public static void LoadFiles (string[] paths, bool clearExisting)
3535

3636
public static async Task HandleFiles(string[] paths, bool clearExisting)
3737
{
38+
Media.GetFrameCountCached.ClearCache();
39+
Media.GetMediaResolutionCached.ClearCache();
40+
Media.GetVideoInfo.ClearCache();
41+
3842
if (clearExisting)
3943
{
4044
ThumbnailView.ClearUi();

0 commit comments

Comments
 (0)