pünktchen 1258 Posted March 15, 2022 Share Posted March 15, 2022 If i have a BaseItem that only has a ProviderId, how can i refresh all other missing metadata, what's the method that i have to use here? Link to comment Share on other sites More sharing options...
Luke 37090 Posted March 15, 2022 Share Posted March 15, 2022 I would just call item.RefreshMetadata. When you construct your MetadataRefreshOptions, set the MetadataRefreshMode to FullRefresh. Link to comment Share on other sites More sharing options...
pünktchen 1258 Posted March 15, 2022 Author Share Posted March 15, 2022 41 minutes ago, Luke said: When you construct your MetadataRefreshOptions Sorry for the noob question, but how can i initialize a new MetadataRefreshOptions object? It would be easy with something like var options = new LibraryOptions() when there' s no need for an argument like here: public class LibraryOptions { public LibraryOptions(); } but for MetadataRefreshOptions i don't how to do that, because the needed argument is also the object i want to initialize: public class MetadataRefreshOptions : ImageRefreshOptions { public MetadataRefreshOptions(MetadataRefreshOptions copy); } And i connot find any existing method that would return MetadataRefreshOptions. Link to comment Share on other sites More sharing options...
pünktchen 1258 Posted March 16, 2022 Author Share Posted March 16, 2022 The solution for MetadataRefreshOptions is to add IFileSystem to the plugin constructor: public class ServerEntryPoint : IServerEntryPoint { public static ServerEntryPoint Instance { get; private set; } public IFileSystem FileSystem; public ServerEntryPoint(IFileSystem fileSystem) { Instance = this; FileSystem = fileSystem; } } and then add that whole FileSystem as argument to initialize new MetadataRefreshOptions: var options = new MetadataRefreshOptions(ServerEntryPoint.Instance.FileSystem) 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now