protected override async Task SynchronizeMods(IContentManager contentList, CollectionVersionModel collectionVersion) { await HandleCustomRepositories(contentList, false).ConfigureAwait(false); await base.SynchronizeMods(contentList, collectionVersion).ConfigureAwait(false); }
protected void UpdateServersInfo(CollectionVersionModel collectionVersion) { if (collectionVersion.Servers != null) { Servers = collectionVersion.Servers.Select( x => new CollectionServer {Address = new ServerAddress(x.Address), Password = x.Password}) .ToList(); } else Servers.Clear(); }
public void SetPublishedInformation(CollectionModel collection, CollectionVersionModel collectionVersion) { if (PublishedId.HasValue && PublishedId.Value != collection.Id) { throw new Exception( "This modSet already has publishing information set and it's id does not match the provided collections id."); } PublishedId = collection.Id; PublishingScope = collection.Scope; UpdatePublishInfo(collectionVersion.Version); _publishedAccountId = collection.AuthorId; }
public virtual async Task UpdateInfoFromOnline(CollectionModel collection, CollectionVersionModel collectionVersion, Account author, IContentManager contentList) { var imageUrl = collection.AvatarUrl == null ? null : "http:" + collection.AvatarUrl; Image = imageUrl; ImageLarge = imageUrl; Name = collection.Name; Description = collectionVersion.Description; Version = collectionVersion.Version.ToString(); UpdatedAt = collectionVersion.ReleasedOn; }
public override async Task UpdateInfoFromOnline(CollectionModel collection, CollectionVersionModel collectionVersion, Account author, IContentManager contentList) { await base.UpdateInfoFromOnline(collection, collectionVersion, author, contentList).ConfigureAwait(false); Subscribers = collection.Subscribers; AuthorAvatarUrl = author.Avatar; Author = author.DisplayName; collectionVersion.Repositories.SyncCollectionLocked(Repositories); UpdateServersInfo(collectionVersion); await SynchronizeMods(contentList, collectionVersion).ConfigureAwait(false); }
public override async Task UpdateInfoFromOnline(CollectionModel collection, CollectionVersionModel collectionVersion, Account author, IContentManager contentList) { await base.UpdateInfoFromOnline(collection, collectionVersion, author, contentList).ConfigureAwait(false); Subscribers = collection.Subscribers; AuthorAvatarUrl = author.Avatar; Author = author.DisplayName; collectionVersion.Repositories.SyncCollectionLocked(Repositories); UpdateServersInfo(collectionVersion); await SynchronizeMods(contentList, collectionVersion).ConfigureAwait(false); }
protected void UpdateServersInfo(CollectionVersionModel collectionVersion) { if (collectionVersion.Servers != null) { Servers = collectionVersion.Servers.Select( x => new CollectionServer { Address = new ServerAddress(x.Address), Password = x.Password }) .ToList(); } else { Servers.Clear(); } }
public override async Task UpdateInfoFromOnline(CollectionModel collection, CollectionVersionModel collectionVersion, Account author, IContentManager contentList) { await base.UpdateInfoFromOnline(collection, collectionVersion, author, contentList).ConfigureAwait(false); Subscribers = collection.Scope == CollectionScope.Private ? (int?)null : collection.Subscribers; if (PublishedVersion == null || PublishedVersion < collectionVersion.Version) { collectionVersion.Repositories.SyncCollection(Repositories); UpdateServersInfo(collectionVersion); await SynchronizeMods(contentList, collectionVersion).ConfigureAwait(false); } // Has to come afterwards because otherwise we don't sync mods on changes... SetPublishedInformation(collection, collectionVersion); }
protected virtual async Task SynchronizeMods(IContentManager contentList, CollectionVersionModel collectionVersion) { foreach (var d in collectionVersion.Dependencies) { SetVersion(d.Dependency, d.Constraint); } var theMods = ConvertToMods(collectionVersion, contentList).ToArray(); RefreshOrders(theMods); theMods.Select(x => x.GetSerializationString()).SyncCollection(AdditionalMods); RequiredMods = theMods.Select(x => x.Name) .Where( x => collectionVersion.Dependencies.Any( d => d.Dependency.Equals(x, StringComparison.InvariantCultureIgnoreCase) && d.IsRequired)) .ToList(); HandleModsetMods(contentList); UpdateState(); }
protected virtual IEnumerable <IMod> ConvertToMods(CollectionVersionModel collectionVersion, IContentManager contentList) => contentList.FindOrCreateLocalMods(Game, collectionVersion.Dependencies.Select(x => x.Dependency));
protected override async Task SynchronizeMods(IContentManager contentList, CollectionVersionModel collectionVersion) { await HandleCustomRepositories(contentList, false).ConfigureAwait(false); await base.SynchronizeMods(contentList, collectionVersion).ConfigureAwait(false); }
protected override IEnumerable<IMod> ConvertToMods(CollectionVersionModel collectionVersion, IContentManager contentList) { return contentList.FindOrCreateLocalMods(Game, collectionVersion.Dependencies.Select(x => x.Dependency), CustomRepoMods); }