Move NeedsRefresh to async task and fix problem finding episode metadata

This commit is contained in:
ebr11 Eric Reed spam
2012-09-18 15:18:15 -04:00
parent e5b5861abf
commit 0f078d8098
6 changed files with 46 additions and 12 deletions

View File

@@ -36,5 +36,26 @@ namespace MediaBrowser.Common.Extensions
}
return false;
}
/// <summary>
/// Helper method for Dictionaries since they throw on not-found keys
/// </summary>
/// <typeparam name="T"></typeparam>
/// <typeparam name="U"></typeparam>
/// <param name="dictionary"></param>
/// <param name="key"></param>
/// <param name="defaultValue"></param>
/// <returns></returns>
public static U GetValueOrDefault<T, U>(this Dictionary<T, U> dictionary, T key, U defaultValue)
{
U val;
if (!dictionary.TryGetValue(key, out val))
{
val = defaultValue;
}
return val;
}
}
}