public void AddNewVersionApp(ReformApp reformApp, QihooAppStoreCompleteApp appItem, AppProject appProject) { try { var appitems = AppStoreUIService.GetAppsFromAppList <AppProject>(appProject.Id); foreach (var a in appitems) { var versions = RedisService.GetAllSubModelIdsByType <App, AppVersion>(a.Id).ToIdsWithNoPrefix <AppVersion>(); if (!versions.Contains(appItem.VersionCode)) { reformApp.NewVersionCount = AddNewVersionForApp(reformApp.NewVersionCount, appItem, a); } else { reformApp.DupVersionCount++; LogHelper.WriteInfo(string.Format("Already has version {1} for app name {0}", appItem.Name, appItem.VersionCode), ConsoleColor.DarkYellow); } } } catch (Exception ex) { LogHelper.WriteError(ex.Message + ex.StackTrace); } }
public void BuildAppProject(ReformApp reformApp, QihooAppStoreCompleteApp appItem) { var appProject = AppStoreUIService.GetAppProjectByPKGName(appItem.PackageName); if (appProject == null) { LogHelper.WriteInfo(string.Format("Has new app, name {0}, downloading...", appItem.Name), ConsoleColor.Yellow); reformApp.NewAppCount++; var appfileName = string.Empty; DownloadResources(appItem, out appfileName); appProject = AddNewApp(appItem, appProject, appfileName); } else { try { var appitems = AppStoreUIService.GetAppsFromAppList <AppProject>(appProject.Id); if (appitems == null) { AppProjectDelete(appProject.Id); } else { AddNewVersionApp(reformApp, appItem, appProject); } } catch (Exception) { AppProjectDelete(appProject.Id); } } }