///<summary>Inserts one UpdateHistory into the database.  Provides option to use the existing priKey.  Doesn't use the cache.</summary>
        public static long InsertNoCache(UpdateHistory updateHistory, bool useExistingPK)
        {
            bool   isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys);
            string command      = "INSERT INTO updatehistory (";

            if (!useExistingPK && isRandomKeys)
            {
                updateHistory.UpdateHistoryNum = ReplicationServers.GetKeyNoCache("updatehistory", "UpdateHistoryNum");
            }
            if (isRandomKeys || useExistingPK)
            {
                command += "UpdateHistoryNum,";
            }
            command += "DateTimeUpdated,ProgramVersion) VALUES(";
            if (isRandomKeys || useExistingPK)
            {
                command += POut.Long(updateHistory.UpdateHistoryNum) + ",";
            }
            command +=
                DbHelper.Now() + ","
                + "'" + POut.String(updateHistory.ProgramVersion) + "')";
            if (useExistingPK || isRandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                updateHistory.UpdateHistoryNum = Db.NonQ(command, true, "UpdateHistoryNum", "updateHistory");
            }
            return(updateHistory.UpdateHistoryNum);
        }
        ///<summary>Inserts one UpdateHistory into the database.  Provides option to use the existing priKey.</summary>
        public static long Insert(UpdateHistory updateHistory, bool useExistingPK)
        {
            if (!useExistingPK && PrefC.RandomKeys)
            {
                updateHistory.UpdateHistoryNum = ReplicationServers.GetKey("updatehistory", "UpdateHistoryNum");
            }
            string command = "INSERT INTO updatehistory (";

            if (useExistingPK || PrefC.RandomKeys)
            {
                command += "UpdateHistoryNum,";
            }
            command += "DateTimeUpdated,ProgramVersion) VALUES(";
            if (useExistingPK || PrefC.RandomKeys)
            {
                command += POut.Long(updateHistory.UpdateHistoryNum) + ",";
            }
            command +=
                DbHelper.Now() + ","
                + "'" + POut.String(updateHistory.ProgramVersion) + "')";
            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                updateHistory.UpdateHistoryNum = Db.NonQ(command, true, "UpdateHistoryNum", "updateHistory");
            }
            return(updateHistory.UpdateHistoryNum);
        }
Esempio n. 3
0
        private void AddHistoryEntry(string pageString, string queryString)
        {
            Regex         regex         = new Regex(".ascx", RegexOptions.IgnoreCase);
            UpdateHistory updateHistory = (UpdateHistory)_page.FindControl("uxUpdateHistory");

            updateHistory.AddEntry(regex.Replace(pageString, ",") + queryString);
        }
Esempio n. 4
0
 ///<summary>Inserts one UpdateHistory into the database.  Returns the new priKey.</summary>
 public static long Insert(UpdateHistory updateHistory)
 {
     if (DataConnection.DBtype == DatabaseType.Oracle)
     {
         updateHistory.UpdateHistoryNum = DbHelper.GetNextOracleKey("updatehistory", "UpdateHistoryNum");
         int loopcount = 0;
         while (loopcount < 100)
         {
             try {
                 return(Insert(updateHistory, true));
             }
             catch (Oracle.ManagedDataAccess.Client.OracleException ex) {
                 if (ex.Number == 1 && ex.Message.ToLower().Contains("unique constraint") && ex.Message.ToLower().Contains("violated"))
                 {
                     updateHistory.UpdateHistoryNum++;
                     loopcount++;
                 }
                 else
                 {
                     throw ex;
                 }
             }
         }
         throw new ApplicationException("Insert failed.  Could not generate primary key.");
     }
     else
     {
         return(Insert(updateHistory, false));
     }
 }
Esempio n. 5
0
        private void FormAbout_Load(object sender, System.EventArgs e)
        {
            string softwareName = PrefC.GetString(PrefName.SoftwareName);

            if (Programs.GetCur(ProgramName.BencoPracticeManagement).Enabled)
            {
                pictureOpenDental.Image = Properties.Resources.bencoLogo;
            }
            if (softwareName != "Open Dental Software" && !Programs.GetCur(ProgramName.BencoPracticeManagement).Enabled)
            {
                pictureOpenDental.Visible = false;
            }
            labelVersion.Text = Lan.g(this, "Version:") + " " + Application.ProductVersion;
            UpdateHistory updateHistory = UpdateHistories.GetForVersion(Application.ProductVersion);

            if (updateHistory != null)
            {
                labelVersion.Text += "  " + Lan.g(this, "Since:") + " " + updateHistory.DateTimeUpdated.ToShortDateString();
            }
            //keeps the trailing year up to date
            labelCopyright.Text      = softwareName + " " + Lan.g(this, "Copyright 2003-") + DateTime.Now.ToString("yyyy") + ", Jordan S. Sparks, D.M.D.";
            labelMySQLCopyright.Text = Lan.g(this, "MySQL - Copyright 1995-") + DateTime.Now.ToString("yyyy") + Lan.g(this, ", www.mysql.com");
            //Database Server----------------------------------------------------------
            List <string> serviceList = Computers.GetServiceInfo();

            labelName.Text         += serviceList[2].ToString();         //MiscData.GetODServer();//server name
            labelService.Text      += serviceList[0].ToString();         //service name
            labelMySqlVersion.Text += serviceList[3].ToString();         //service version
            labelServComment.Text  += serviceList[1].ToString();         //service comment
            labelMachineName.Text  += Environment.MachineName.ToUpper(); //current client or remote application machine name
        }
Esempio n. 6
0
 public void AddNewUpdateHistory(UpdateHistory updateHistory)
 {
     using (var context = new ManufacturingDataContext(_connectionString))
     {
         context.UpdateHistories.InsertOnSubmit(updateHistory);
         context.SubmitChanges();
     }
 }
 ///<summary>Returns true if Update(UpdateHistory,UpdateHistory) would make changes to the database.
 ///Does not make any changes to the database and can be called before remoting role is checked.</summary>
 public static bool UpdateComparison(UpdateHistory updateHistory, UpdateHistory oldUpdateHistory)
 {
     //DateTimeUpdated not allowed to change
     if (updateHistory.ProgramVersion != oldUpdateHistory.ProgramVersion)
     {
         return(true);
     }
     return(false);
 }
        ///<summary>Updates one UpdateHistory in the database.</summary>
        public static void Update(UpdateHistory updateHistory)
        {
            string command = "UPDATE updatehistory SET "
                             //DateTimeUpdated not allowed to change
                             + "ProgramVersion  = '" + POut.String(updateHistory.ProgramVersion) + "' "
                             + "WHERE UpdateHistoryNum = " + POut.Long(updateHistory.UpdateHistoryNum);

            Db.NonQ(command);
        }
Esempio n. 9
0
        private void SearchBindData(bool newSearch)
        {
            try
            {
                if (newSearch && !CheckSearchRequest())
                {
                    return;
                }
                else if (newSearch || Mession.SearchData == null)
                {
                    SearchWhatFlags sw      = (SearchWhatFlags)System.Enum.Parse(typeof(SearchWhatFlags), listSearchWhat.SelectedValue);
                    SearchWhatFlags sfw     = (SearchWhatFlags)System.Enum.Parse(typeof(SearchWhatFlags), listSearchFromWho.SelectedValue);
                    int             forumID = int.Parse(listForum.SelectedValue);

                    DataTable searchDataTable = YAF.Classes.Data.DB.GetSearchResult(txtSearchStringWhat.Text,
                                                                                    txtSearchStringFromWho.Text, sfw, sw, forumID,
                                                                                    PageContext.PageUserID, PageContext.PageBoardID,
                                                                                    PageContext.BoardSettings.ReturnSearchMax,
                                                                                    PageContext.BoardSettings.UseFullTextSearch);
                    Pager.CurrentPageIndex = 0;
                    Pager.PageSize         = int.Parse(listResInPage.SelectedValue);
                    Pager.Count            = searchDataTable.DefaultView.Count;
                    Mession.SearchData     = searchDataTable;

                    bool bResults = (searchDataTable.DefaultView.Count > 0) ? true : false;

                    SearchRes.Visible = bResults;
                    NoResults.Visible = !bResults;
                }

                PagedDataSource pds = new PagedDataSource();
                pds.AllowPaging      = true;
                pds.DataSource       = Mession.SearchData.DefaultView;
                pds.PageSize         = Pager.PageSize;
                pds.CurrentPageIndex = Pager.CurrentPageIndex;

                UpdateHistory.AddEntry(Pager.CurrentPageIndex.ToString() + "|" + Pager.PageSize);

                SearchRes.DataSource = pds;
                SearchRes.DataBind();
            }
            catch (Exception x)
            {
                YAF.Classes.Data.DB.eventlog_create(PageContext.PageUserID, this, x);
                CreateMail.CreateLogEmail(x);

                if (PageContext.IsAdmin)
                {
                    PageContext.AddLoadMessage(string.Format("{0}", x));
                }
                else
                {
                    PageContext.AddLoadMessage("An error occured while searching.");
                }
            }
        }
Esempio n. 10
0
        public IActionResult Create([FromBody] UpdateHistory item)
        {
            if (item == null)
            {
                return(BadRequest());
            }

            item.Id = db.GetSequence <UpdateHistory>();
            db.InsertData <UpdateHistory>(item);

            return(Ok(new { id = item.Id }));
        }
Esempio n. 11
0
        public void AddNewUpdateHistory(dynamic obj, string action = "updated")
        {
            action = action ?? "updated";
            var updateHistory = new UpdateHistory
            {
                Action        = action,
                PropertyId    = obj.Id,
                PropertyType  = obj.GetType().Name,
                OldObjectData = Helpers.GetBasePropertiesOnDbObject(obj)
            };

            AddNewUpdateHistory(updateHistory);
        }
Esempio n. 12
0
 private void FrmWeixinRobot_Load(object sender, EventArgs e)
 {
     try
     {
         dvList.AutoGenerateColumns = false;
         var list = UpdateHistory.GetList(ServerConfigId);
         dvList.DataSource = list;
     }
     catch (Exception ex)
     {
         MessageBox.Show("加载发版历史失败:" + ex.ToString());
     }
 }
Esempio n. 13
0
        public IActionResult PutData([FromRoute] int id, [FromBody] UpdateHistory item)
        {
            if (item == null)
            {
                return(BadRequest());
            }

            if (item.Id > 0)
            {
                db.InsertData <UpdateHistory>(item);
            }

            return(Ok(new { id = item.Id }));
        }
Esempio n. 14
0
        ///<summary>Converts a DataTable to a list of objects.</summary>
        public static List <UpdateHistory> TableToList(DataTable table)
        {
            List <UpdateHistory> retVal = new List <UpdateHistory>();
            UpdateHistory        updateHistory;

            foreach (DataRow row in table.Rows)
            {
                updateHistory = new UpdateHistory();
                updateHistory.UpdateHistoryNum = PIn.Long(row["UpdateHistoryNum"].ToString());
                updateHistory.DateTimeUpdated  = PIn.DateT(row["DateTimeUpdated"].ToString());
                updateHistory.ProgramVersion   = PIn.String(row["ProgramVersion"].ToString());
                retVal.Add(updateHistory);
            }
            return(retVal);
        }
Esempio n. 15
0
 ///<summary>Inserts one UpdateHistory into the database.  Returns the new priKey.  Doesn't use the cache.</summary>
 public static long InsertNoCache(UpdateHistory updateHistory)
 {
     if (DataConnection.DBtype == DatabaseType.MySql)
     {
         return(InsertNoCache(updateHistory, false));
     }
     else
     {
         if (DataConnection.DBtype == DatabaseType.Oracle)
         {
             updateHistory.UpdateHistoryNum = DbHelper.GetNextOracleKey("updatehistory", "UpdateHistoryNum");                  //Cacheless method
         }
         return(InsertNoCache(updateHistory, true));
     }
 }
 private void WriteUpdateHistory(IChannelHandlerContext context, UpdateData data)
 {
     try
     {
         var history = new UpdateHistory();
         history.ServerConfigId   = data.Config.Id;
         history.ServerConfigName = data.Config.Name;
         history.FileCount        = data.Files.Length;
         UpdateHistory.Insert(history);
         WriteMessage(context, $"2.1 -- 记录更新历史...");
     }
     catch
     {
     }
 }
Esempio n. 17
0
 public bool addUpdateHistory(UpdateHistory updateHistory)
 {
     using (SqliteContext context = new CAAC_LawLibrary.SqliteContext())
     {
         try
         {
             context.UpdateHistory.Add(updateHistory);
             context.SaveChanges();
             return(true);
         }
         catch (Exception)
         {
             return(false);
         }
     }
 }
Esempio n. 18
0
        private void FormUpdate_Load(object sender, System.EventArgs e)
        {
            if (ODBuild.IsWeb())
            {
                MsgBox.Show(this, "Updates are not allowed manually from within the program. Please call support.");
                Close();
                return;
            }
            SetButtonVisibility();
            labelVersion.Text = Lan.g(this, "Using Version:") + " " + Application.ProductVersion;
            UpdateHistory updateHistory = UpdateHistories.GetForVersion(Application.ProductVersion);

            if (updateHistory != null)
            {
                labelVersion.Text += "  " + Lan.g(this, "Since") + ": " + updateHistory.DateTimeUpdated.ToShortDateString();
            }
            if (PrefC.GetBool(PrefName.UpdateWindowShowsClassicView))
            {
                //Default location is (74,9).  We move it 5 pixels up since butShowPrev is 5 pixels bigger then labelVersion
                butShowPrev.Location  = new Point(74 + labelVersion.Width + 2, 9 - 5);
                panelClassic.Visible  = true;
                panelClassic.Location = new Point(67, 29);
                textUpdateCode.Text   = PrefC.GetString(PrefName.UpdateCode);
                textWebsitePath.Text  = PrefC.GetString(PrefName.UpdateWebsitePath); //should include trailing /
                butDownload.Enabled   = false;
                if (!Security.IsAuthorized(Permissions.Setup))                       //gives a message box if no permission
                {
                    butCheck.Enabled = false;
                }
            }
            else
            {
                if (Security.IsAuthorized(Permissions.Setup, true))
                {
                    butCheck2.Visible = true;
                }
                else
                {
                    textConnectionMessage.Text = Lan.g(this, "Not authorized for") + " " + GroupPermissions.GetDesc(Permissions.Setup);
                }
            }
        }
Esempio n. 19
0
        ///<summary>Inserts an UpdateHistory for the version passed in if there is no entry for that version. Returns the primary key of the row inserted
        ///or 0 if an UpdateHistory of that version already exists.</summary>
        public static long CreateUpdateHistory(string version, DateTime dateTimeUpdate = default(DateTime))
        {
            List <UpdateHistory> listUpdates = UpdateHistories.GetAll();

            if (listUpdates.Any(x => x.ProgramVersion == version))
            {
                return(0);
            }
            UpdateHistory update = new UpdateHistory();

            update.ProgramVersion = "16.1.1.0";
            long updateHistoryNum = UpdateHistories.Insert(update);

            if (dateTimeUpdate != default(DateTime))
            {
                //DateTimeUpdated is a DateTEntry column, so we have to forcefully update it.
                string command = "UPDATE updatehistory SET DateTimeUpdated=" + POut.DateT(dateTimeUpdate) + " WHERE UpdateHistoryNum=" + POut.Long(updateHistoryNum);
                DataCore.NonQ(command);
            }
            return(updateHistoryNum);
        }
Esempio n. 20
0
        ///<summary>Updates one UpdateHistory in the database.  Uses an old object to compare to, and only alters changed fields.  This prevents collisions and concurrency problems in heavily used tables.  Returns true if an update occurred.</summary>
        public static bool Update(UpdateHistory updateHistory, UpdateHistory oldUpdateHistory)
        {
            string command = "";

            //DateTimeUpdated not allowed to change
            if (updateHistory.ProgramVersion != oldUpdateHistory.ProgramVersion)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ProgramVersion = '" + POut.String(updateHistory.ProgramVersion) + "'";
            }
            if (command == "")
            {
                return(false);
            }
            command = "UPDATE updatehistory SET " + command
                      + " WHERE UpdateHistoryNum = " + POut.Long(updateHistory.UpdateHistoryNum);
            Db.NonQ(command);
            return(true);
        }
Esempio n. 21
0
        /// <summary>
        /// Default function for background task
        /// </summary>
        /// <param name="taskInstance"></param>
        public async void Run(IBackgroundTaskInstance taskInstance)
        {
            deferral = taskInstance.GetDeferral();

            UpdateHistory <UpdateHistoryKeys> upHis = new UpdateHistory <UpdateHistoryKeys>(updateHistoryList);

            foreach (var item in await upHis.GetUpdateHistoryListAsync())
            {
                switch (item.Key)
                {
                case UpdateHistoryKeys.Decryption:
                    if (!await upHis.CheckKeyAsync(item.Key.ToString()))
                    {
                        await ItemsEncryption();
                    }
                    break;

                case UpdateHistoryKeys.FileRename:
                    if (!await upHis.CheckKeyAsync(item.Key.ToString()))
                    {
                        await FilesRename();
                    }
                    break;

                case UpdateHistoryKeys.ItemStorageChange:
                    if (!await upHis.CheckKeyAsync(item.Key.ToString()))
                    {
                        await ItemStorageChangeAsync();
                    }
                    break;

                default:
                    break;
                }
            }

            deferral.Complete();
        }
Esempio n. 22
0
        private void BtnSvnLog_Click(object sender, EventArgs e)
        {
            if (tvServers.SelectedNode == null)
            {
                MessageBox.Show("请选择发版服务器");
                return;
            }

            try
            {
                var nodeData = tvServers.SelectedNode.Tag as ServerConfig;
                if (nodeData != null)
                {
                    if (string.IsNullOrEmpty(nodeData.SvnPath))
                    {
                        MessageBox.Show("SVN地址不能为空");
                        return;
                    }

                    var       lastUpdateDate = UpdateHistory.GetLatest(nodeData.Id).PublishAt;
                    FrmSvnLog frmSvnLog      = new FrmSvnLog();
                    frmSvnLog.LastUpdateTime = lastUpdateDate.AddMinutes(-30);
                    frmSvnLog.SvnPath        = nodeData.SvnPath;
                    frmSvnLog.ShowDialog(this);
                }
                else
                {
                    MessageBox.Show("请选择发版服务器");
                    return;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("获取SVN文件异常:" + ex.Message);
            }
        }
Esempio n. 23
0
 public void OnCustomMenuItemClick(string menuItem, ControlProperties controlProperties, UpdateHistory updateBack)
 {
     if (updateBack != null)
     {
         updateBack(string.Format(menuItem, " handle " + ":" + controlProperties.ClassName + ":" + controlProperties.Caption));
     }
 }
Esempio n. 24
0
 /// <summary>
 /// 刷新法规
 /// </summary>
 /// <param name="laws"></param>
 /// <returns></returns>
 public bool refreshLaw(List <Law> laws, out int autoUpdateCount)
 {
     using (SqliteContext context = new SqliteContext())
     {
         try
         {
             int updateLawCount = 0;
             foreach (Law law in laws.OrderBy(l => l.lawId))
             {
                 var currentLaw = context.Law.FirstOrDefault(l => l.lawId == law.lawId && l.userId == Global.user.Id);
                 if (currentLaw == null)//如果没有就新增
                 {
                     law.userId = Global.user.Id;
                     //如果是更新版本的法规(且法规旧版本已下载至本地),将更新信息保存至自动更新历史记录表,同时自动下载新版本法规内容
                     var oldDownloadedLaw = context.Law.FirstOrDefault(l => l.lastversion == law.lastversion && l.isLocal == "1" && l.userId == Global.user.Id);
                     if (oldDownloadedLaw != null)
                     {
                         List <Node> nodes = RemoteWorker.getBookContent(law.lawId);
                         RemoteWorker.getNodeDetail(nodes.Select(n => n.Id).ToList());
                         law.isLocal           = "1";
                         law.downloadPercent   = 100;
                         law.downloadNodeCount = nodes.Count;
                         law.downloadDate      = DateTime.Now.ToString("yyyy-MM-dd");
                         UpdateHistory updateHistory = new UpdateHistory();
                         updateHistory.LawId      = law.lawId;
                         updateHistory.LawTitle   = law.title;
                         updateHistory.UpdateDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                         updateHistory.UserId     = Global.user.Id;
                         updateHistory.Version    = law.version;
                         updateHistory.Id         = Guid.NewGuid().ToString();
                         addUpdateHistory(updateHistory);
                         updateLawCount++;
                     }
                     else
                     {
                         //如果是更新版本的法规(且法规旧版本未下载至本地),只更新法规列表界面的版本
                         var oldUndownloadLaw = context.Law.FirstOrDefault(l => l.lastversion == law.lastversion && l.userId == Global.user.Id);
                         if (oldUndownloadLaw != null)
                         {
                             updateLawCount++;
                         }
                     }
                     context.Law.Add(law);
                 }
                 else//如果有就更新基本信息,但不更新是否下载到本地、下载时间、下载进度、用户id等本地信息。
                 {
                     currentLaw.name          = law.name;
                     currentLaw.buhao         = law.buhao;
                     currentLaw.digest        = law.digest;
                     currentLaw.effectiveDate = law.effectiveDate;
                     currentLaw.expiryDate    = law.expiryDate;
                     currentLaw.keyword       = law.keyword;
                     currentLaw.lastversion   = law.lastversion;
                     currentLaw.linghao       = law.linghao;
                     currentLaw.siju          = law.siju;
                     currentLaw.status        = law.status;
                     currentLaw.title         = law.title;
                     currentLaw.userLabel     = law.userLabel;
                     currentLaw.version       = law.version;
                     currentLaw.weijie        = law.weijie;
                     currentLaw.xiudingling   = law.xiudingling;
                     currentLaw.yewu          = law.yewu;
                     currentLaw.yilai         = law.yilai;
                     currentLaw.zefa          = law.zefa;
                 }
                 context.SaveChanges();
             }
             //context.SaveChanges();
             autoUpdateCount = updateLawCount;
             MessageBox.Show("新版法规自动更新完成,本次共更新了" + updateLawCount.ToString() + "个法规的新版本");
             return(true);
         }
         catch (Exception ex)
         {
             autoUpdateCount = -1;
             return(false);
         }
     }
 }
Esempio n. 25
0
        public async Task <Updates> Updates(ISession session)
        {
            try
            {
                Updates upds = new Updates();
                upds.Items = new List <Episode>();
                if (!UpdateHistory.IsLoaded)
                {
                    UpdateHistory.Load();
                }
                DaiSukiSession s = session as DaiSukiSession;
                if (s == null)
                {
                    return new Updates {
                               ErrorMessage = "Invalid Session", Status = ResponseStatus.InvalidArgument
                    }
                }
                ;
                Shows sws = await Shows(s, false);

                if (sws.Status != ResponseStatus.Ok)
                {
                    Updates k = new Updates();

                    sws.PropagateError(k);
                    return(k);
                }
                int                     cnt = Convert.ToInt32(GetAuthSetting(DaiSukiPluginInfo.MaxFollowItems));
                List <Show>             avs = sws.Items.Take(cnt).ToList();
                List <Task <Episodes> > ms  = new List <Task <Episodes> >();
                foreach (Show sh in avs)
                {
                    ms.Add(Episodes(s, sh));
                }
                string datetime = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
                if (ms.Count > 0)
                {
                    while (ms.Count > 0)
                    {
                        int max = 5;
                        if (ms.Count < 5)
                        {
                            max = ms.Count;
                        }
                        Task <Episodes>[] tsks = new Task <Episodes> [max];
                        for (int x = 0; x < max; x++)
                        {
                            tsks[x] = ms[0];
                            ms.Remove(ms[0]);
                        }
                        await Task.WhenAll(tsks);

                        for (int x = max - 1; x >= 0; x--)
                        {
                            if (tsks[x].Result != null)
                            {
                                if (tsks[x].Result.Items.Count > 0)
                                {
                                    Episode ep = tsks[x].Result.Items.OrderByDescending(a => a.Index).First();
                                    ep.UniqueTag = DaiSukiPluginInfo.PluginName + "|" + ep.ShowName + "|" +
                                                   ep.EpisodeAlpha;
                                    if (UpdateHistory.Exists(ep.UniqueTag))
                                    {
                                        Episode c =
                                            JsonConvert.DeserializeObject <Episode>(UpdateHistory.Get(ep.UniqueTag));
                                        upds.Items.Add(c);
                                    }
                                    else
                                    {
                                        ep.DateTime = datetime;
                                        UpdateHistory.Add(ep.UniqueTag, JsonConvert.SerializeObject(ep));
                                        upds.Items.Add(ep);
                                    }
                                }
                            }
                        }
                    }
                    UpdateHistory.Save();
                }
                return(upds);
            }
            catch (Exception e)
            {
                return(new Updates {
                    ErrorMessage = e.ToString(), Status = ResponseStatus.SystemError
                });
            }
        }
Esempio n. 26
0
        public async Task <IHttpActionResult> PatchFile(int fileid, string mimeType, string filesize, int userid)
        {
            string       root   = HttpContext.Current.Server.MapPath("~/App_Data/");
            BinaryWriter Writer = null;

            try
            {
                // authenticate
                // return BadRequest("403");

                // get file info
                var files = (from j in db.FileLists
                             where j.fileid == fileid
                             select j);
                var file = files.FirstOrDefault();  // needed to get the file name

                // validation
                if (files.Count() != 1)
                {
                    return(BadRequest("400"));
                }
                if (Int32.Parse(filesize) > 1000000)
                {
                    return(BadRequest("400"));
                }
                if (!File.Exists(root + file.filename))
                {
                    return(BadRequest("400"));
                }

                // Read the form data.
                string strFile = await Request.Content.ReadAsStringAsync();

                // Delete File
                File.Delete(root + file.filename);

                // Save File
                Byte[] bytes = Convert.FromBase64String(strFile.Substring(strFile.IndexOf(",") + 1));
                Writer = new BinaryWriter(File.OpenWrite(root + file.filename));

                // Writer raw data
                Writer.Write(bytes);
                Writer.Flush();
                Writer.Close();

                // Update entry in database
                file.filesize         = filesize;
                file.mimeType         = mimeType;
                file.modificationDate = DateTime.Now;

                // Add entry in UpdateHistory
                UpdateHistory log = new UpdateHistory();
                log.userid          = userid;
                log.updateTimestamp = DateTime.Now;
                log.prevfilename    = file.filename;
                log.filename        = file.filename;
                db.UpdateHistories.Add(log);

                db.SaveChanges();
            }
            catch (System.Exception e)
            {
                Writer.Flush();
                Writer.Close();

                return(BadRequest("500"));
            }

            return(Ok("204"));
        }
Esempio n. 27
0
        public void EnsureSeedData()
        {
            Database.EnsureCreated();
            if (Page.Any() || ContentCard.Any() || Group.Any())
            {
                return;
            }

            Page.AddRange(
                new Page()
            {
                Id         = "root",
                Title      = "Top",
                Summary    = "このサイトでは、{0}が大学演習科目で作成した成果物を陳列しております。特に価値有るものはありませんがゆっくりしていって下さい。",
                Controller = "Home",
                Action     = "Index",
                Parameters = string.Empty,
                Child      = new[]
                {
                    new Page()
                    {
                        Order      = 0,
                        Id         = "root/about",
                        Title      = "About",
                        Summary    = "サイトの構成や、制作者について、感想の類が書いてあります。",
                        Controller = "Home",
                        Action     = "About",
                        Parameters = string.Empty,
                    },
                    new Page()
                    {
                        Order      = 1,
                        Id         = "root/gallery",
                        Title      = "Gallery",
                        Summary    = "授業で作成した成果物を陳列してあります。",
                        Controller = "Home",
                        Action     = "Gallery",
                        Parameters = string.Empty,
                        Child      = new[]
                        {
                            new Page()
                            {
                                Order        = 0,
                                Id           = "root/gallery/100720infoExpr",
                                Title        = "大学演習科目課題",
                                Summary      = "授業の課題で作成した成果物を陳列しています。",
                                Description  = "色々、授業の課題で作ったものや、作る過程で破棄されたもの等を陳列してます。",
                                ThumbnailUrl = "~/gallery/100720infoExpr/image/thumb.jpg",
                                Controller   = "Gallery",
                                Action       = "List",
                                Parameters   = "article=100720infoExpr",
                                Child        = new[]
                                {
                                    new Page()
                                    {
                                        Order        = 0,
                                        Id           = "root/gallery/100720infoExpr/0",
                                        Title        = "第4-5回: plants animal",
                                        Summary      = "Photoshopを使用し、素材から似たな部分を見つけて架空の生物を作成しました。",
                                        ThumbnailUrl = "~/gallery/100720infoExpr/k05th_animalplant/thumb.jpg",
                                        Controller   = "Gallery",
                                        Action       = "Detail",
                                        Parameters   = "article=100720infoExpr&id=0"
                                    },
                                    new Page()
                                    {
                                        Order        = 1,
                                        Id           = "root/gallery/100720infoExpr/1",
                                        Title        = "第6回: Flashアニメーション",
                                        Summary      = "モーションガイドを利用したアニメーションを作成。蛇口から水滴が垂れる状況をFlashで表現しました。",
                                        ThumbnailUrl = "~/gallery/100720infoExpr/k06th_flashmotion/thumb.jpg",
                                        Controller   = "Gallery",
                                        Action       = "Detail",
                                        Parameters   = "article=100720infoExpr&id=1",
                                    },
                                    new Page()
                                    {
                                        Order        = 2,
                                        Id           = "root/gallery/100720infoExpr/2",
                                        Title        = "第7回: Flash動的表現",
                                        Summary      = "ActionScriptを用いたインタラクティブな表現。スイッチの状態に合わせてコンビニおにぎりを切り替えるFlashを作成しました。",
                                        ThumbnailUrl = "~/gallery/100720infoExpr/k07th_flashas/thumb.jpg",
                                        Controller   = "Gallery",
                                        Action       = "Detail",
                                        Parameters   = "article=100720infoExpr&id=2"
                                    },
                                    new Page()
                                    {
                                        Order        = 3,
                                        Id           = "root/gallery/100720infoExpr/3",
                                        Title        = "第8回: HTMLのマークアップ",
                                        Summary      = "関心のあるテーマでWeb ページを作成しました。",
                                        ThumbnailUrl = "~/gallery/100720infoExpr/k08th_html/thumb.jpg",
                                        Controller   = "Gallery",
                                        Action       = "Detail",
                                        Parameters   = "article=100720infoExpr&id=3"
                                    },
                                    new Page()
                                    {
                                        Order        = 4,
                                        Id           = "root/gallery/100720infoExpr/4",
                                        Title        = "第9回: CSSを加えたもの",
                                        Summary      = "CSSを用いてウェブページのh1タグ等に装飾を施しました。",
                                        ThumbnailUrl = "~/gallery/100720infoExpr/k09th_htmlcss1/thumb.jpg",
                                        Controller   = "Gallery",
                                        Action       = "Detail",
                                        Parameters   = "article=100720infoExpr&id=4"
                                    },
                                    new Page()
                                    {
                                        Order        = 5,
                                        Id           = "root/gallery/100720infoExpr/5",
                                        Title        = "第10回: CSSページレイアウト",
                                        Summary      = "第9回のCSSの学習をさらに進め、divタグを用いたページレイアウトやlistタグの挙動を変えたりしました。",
                                        ThumbnailUrl = "~/gallery/100720infoExpr/k10th_htmlcss2/thumb.jpg",
                                        Controller   = "Gallery",
                                        Action       = "Detail",
                                        Parameters   = "article=100720infoExpr&id=5"
                                    },
                                    new Page()
                                    {
                                        Order        = 6,
                                        Id           = "root/gallery/100720infoExpr/6",
                                        Title        = "第11回: リンク集",
                                        Summary      = "これまでのHTML&CSSの知識を総動員し、お勧めのサイトを集めたリンク集を作りました。",
                                        ThumbnailUrl = "~/gallery/100720infoExpr/k11th_link/thumb.jpg",
                                        Controller   = "Gallery",
                                        Action       = "Detail",
                                        Parameters   = "article=100720infoExpr&id=6"
                                    },
                                    new Page()
                                    {
                                        Order        = 7,
                                        Id           = "root/gallery/100720infoExpr/7",
                                        Title        = "第12回:演習課題掲載サイト",
                                        Summary      = "これまで授業で学んだの知識を総動員し、ウェブサイトを構築しました。",
                                        ThumbnailUrl = "~/gallery/100720infoExpr/k12th_web/thumb.jpg",
                                        Controller   = "Gallery",
                                        Action       = "Detail",
                                        Parameters   = "article=100720infoExpr&id=7"
                                    },
                                    new Page()
                                    {
                                        Order        = 8,
                                        Id           = "root/gallery/100720infoExpr/8",
                                        Title        = "オブジェクト指向習作",
                                        Summary      = "世界各国の首都をGoogleMapsを用いて表示してみました。",
                                        ThumbnailUrl = "~/gallery/100720infoExpr/oop_js/thumb.jpg",
                                        Controller   = "Gallery",
                                        Action       = "Detail",
                                        Parameters   = "article=100720infoExpr&id=8"
                                    },
                                }
                            },
                            new Page()
                            {
                                Order        = 1,
                                Id           = "root/gallery/100823takao",
                                Title        = "夏季休暇課題",
                                Summary      = "高尾山の夏の動植物諸々、見つけた物を片っ端から撮って調べてみました。",
                                Description  = "高尾山は標高が低く都心からとても近い山ですが、とても動植物が多い山として知られています。今回は川が近くに流れる6号路を通りました。そのため、湿った場所に生える植物が沢山撮られています。また、ついでに写真のサイズについてですが、古いコンデジであるために低解像度&低感度&高ノイズ&手ブレ補正無しで、散々な写りとなってしまいました。そのため、縮小して誤魔化しています。ご容赦を。",
                                ThumbnailUrl = "~/gallery/100823takao/image/thumb.jpg",
                                Controller   = "Gallery",
                                Action       = "List",
                                Parameters   = "article=100823takao",
                                Child        = new[]
                                {
                                    new Page()
                                    {
                                        Order        = 0,
                                        Id           = "root/gallery/100823takao/0",
                                        Title        = "ダイコンソウ",
                                        Summary      = "バラ科ダイコンソウ属",
                                        ThumbnailUrl = "~/gallery/100823takao/dikn/thumb.jpg",
                                        Controller   = "Gallery",
                                        Action       = "Detail",
                                        Parameters   = "article=100823takao&id=0"
                                    },
                                    new Page()
                                    {
                                        Order        = 1,
                                        Id           = "root/gallery/100823takao/1",
                                        Title        = "ゲジゲジシダ",
                                        Summary      = "ヒメシダ科ヒメシダ属",
                                        ThumbnailUrl = "~/gallery/100823takao/gezi/thumb.jpg",
                                        Controller   = "Gallery",
                                        Action       = "Detail",
                                        Parameters   = "article=100823takao&id=1"
                                    },
                                    new Page()
                                    {
                                        Order        = 2,
                                        Id           = "root/gallery/100823takao/2",
                                        Title        = "ハナイカダ",
                                        Summary      = "ミズキ科ハナイカダ属",
                                        ThumbnailUrl = "~/gallery/100823takao/hana/thumb.jpg",
                                        Controller   = "Gallery",
                                        Action       = "Detail",
                                        Parameters   = "article=100823takao&id=2"
                                    },
                                    new Page()
                                    {
                                        Order        = 3,
                                        Id           = "root/gallery/100823takao/3",
                                        Title        = "ヘビイチゴ",
                                        Summary      = "バラ科ヘビイチゴ属",
                                        ThumbnailUrl = "~/gallery/100823takao/hebi/thumb.jpg",
                                        Controller   = "Gallery",
                                        Action       = "Detail",
                                        Parameters   = "article=100823takao&id=3"
                                    },
                                    new Page()
                                    {
                                        Order        = 4,
                                        Id           = "root/gallery/100823takao/4",
                                        Title        = "イノデ",
                                        Summary      = "オシダ科イノデ属",
                                        ThumbnailUrl = "~/gallery/100823takao/inod/thumb.jpg",
                                        Controller   = "Gallery",
                                        Action       = "Detail",
                                        Parameters   = "article=100823takao&id=4"
                                    },
                                    new Page()
                                    {
                                        Order        = 5,
                                        Id           = "root/gallery/100823takao/5",
                                        Title        = "ヤマキツネノボタン",
                                        Summary      = "キンポウゲ科キンポウゲ属",
                                        ThumbnailUrl = "~/gallery/100823takao/ktne/thumb.jpg",
                                        Controller   = "Gallery",
                                        Action       = "Detail",
                                        Parameters   = "article=100823takao&id=5"
                                    },
                                    new Page()
                                    {
                                        Order        = 6,
                                        Id           = "root/gallery/100823takao/6",
                                        Title        = "ミズヒキ",
                                        Summary      = "タデ科ミズヒキ属",
                                        ThumbnailUrl = "~/gallery/100823takao/mizk/thumb.jpg",
                                        Controller   = "Gallery",
                                        Action       = "Detail",
                                        Parameters   = "article=100823takao&id=6"
                                    },
                                    new Page()
                                    {
                                        Order        = 7,
                                        Id           = "root/gallery/100823takao/7",
                                        Title        = "ミヤマフユイチゴ",
                                        Summary      = "バラ科キイチゴ属",
                                        ThumbnailUrl = "~/gallery/100823takao/myic/thumb.jpg",
                                        Controller   = "Gallery",
                                        Action       = "Detail",
                                        Parameters   = "article=100823takao&id=7"
                                    },
                                    new Page()
                                    {
                                        Order        = 8,
                                        Id           = "root/gallery/100823takao/8",
                                        Title        = "シャガ",
                                        Summary      = "アヤメ科アヤメ属",
                                        ThumbnailUrl = "~/gallery/100823takao/shga/thumb.jpg",
                                        Controller   = "Gallery",
                                        Action       = "Detail",
                                        Parameters   = "article=100823takao&id=8"
                                    },
                                    new Page()
                                    {
                                        Order        = 9,
                                        Id           = "root/gallery/100823takao/9",
                                        Title        = "タマアジサイ",
                                        Summary      = "アジサイ科アジサイ属",
                                        ThumbnailUrl = "~/gallery/100823takao/tama/thumb.jpg",
                                        Controller   = "Gallery",
                                        Action       = "Detail",
                                        Parameters   = "article=100823takao&id=9"
                                    },
                                    new Page()
                                    {
                                        Order        = 10,
                                        Id           = "root/gallery/100823takao/10",
                                        Title        = "ホオノキ",
                                        Summary      = "モクレン科モクレン属",
                                        ThumbnailUrl = "~/gallery/100823takao/hono/thumb.jpg",
                                        Controller   = "Gallery",
                                        Action       = "Detail",
                                        Parameters   = "article=100823takao&id=10"
                                    },
                                    new Page()
                                    {
                                        Order        = 11,
                                        Id           = "root/gallery/100823takao/11",
                                        Title        = "モミ",
                                        Summary      = "マツ科モミ属",
                                        ThumbnailUrl = "~/gallery/100823takao/momi/thumb.jpg",
                                        Controller   = "Gallery",
                                        Action       = "Detail",
                                        Parameters   = "article=100823takao&id=11"
                                    },
                                    new Page()
                                    {
                                        Order        = 12,
                                        Id           = "root/gallery/100823takao/12",
                                        Title        = "スダジイ",
                                        Summary      = "ブナ科シイ属",
                                        ThumbnailUrl = "~/gallery/100823takao/sdzi/thumb.jpg",
                                        Controller   = "Gallery",
                                        Action       = "Detail",
                                        Parameters   = "article=100823takao&id=12"
                                    },
                                    new Page()
                                    {
                                        Order        = 13,
                                        Id           = "root/gallery/100823takao/13",
                                        Title        = "ウラジロガシ",
                                        Summary      = "ブナ科コナラ属",
                                        ThumbnailUrl = "~/gallery/100823takao/uraz/thumb.jpg",
                                        Controller   = "Gallery",
                                        Action       = "Detail",
                                        Parameters   = "article=100823takao&id=13"
                                    },
                                    new Page()
                                    {
                                        Order        = 14,
                                        Id           = "root/gallery/100823takao/14",
                                        Title        = "カゴノキ",
                                        Summary      = "クスノキ科カゴノキ属",
                                        ThumbnailUrl = "~/gallery/100823takao/kago/thumb.jpg",
                                        Controller   = "Gallery",
                                        Action       = "Detail",
                                        Parameters   = "article=100823takao&id=14"
                                    },
                                    new Page()
                                    {
                                        Order        = 15,
                                        Id           = "root/gallery/100823takao/15",
                                        Title        = "粘板岩",
                                        Summary      = "堆積岩",
                                        ThumbnailUrl = "~/gallery/100823takao/neba/thumb.jpg",
                                        Controller   = "Gallery",
                                        Action       = "Detail",
                                        Parameters   = "article=100823takao&id=15"
                                    },
                                    new Page()
                                    {
                                        Order        = 16,
                                        Id           = "root/gallery/100823takao/16",
                                        Title        = "ザトウムシ",
                                        Summary      = "クモ綱ザトウムシ目",
                                        ThumbnailUrl = "~/gallery/100823takao/zato/thumb.jpg",
                                        Controller   = "Gallery",
                                        Action       = "Detail",
                                        Parameters   = "article=100823takao&id=16"
                                    },
                                }
                            },
                            new Page()
                            {
                                Order        = 2,
                                Id           = "root/gallery/170128experiment",
                                Title        = "実験場",
                                Summary      = "色々試す場所",
                                Description  = "(´・ω・`)...",
                                ThumbnailUrl = "~/gallery/170128experiment/image/thumb.gif",
                                Controller   = "Gallery",
                                Action       = "List",
                                Parameters   = "article=170128experiment",
                            },
                        }
                    },
                    new Page()
                    {
                        Order      = 2,
                        Id         = "root/product",
                        Title      = "Product",
                        Summary    = "色々、(中間)生成物を保管しています。",
                        Controller = "Home",
                        Action     = "Product",
                        Parameters = string.Empty,
                        Child      = new[]
                        {
                            new Page()
                            {
                                Id           = "root/product/snippet",
                                Title        = "Snippet",
                                Summary      = "このサイトを作成する際に作成したものを使いやすい形にして陳列しています。",
                                ThumbnailUrl = "~/product/snippet/image/thumb.gif",
                                Controller   = "Snippet",
                                Action       = "Index",
                                Parameters   = string.Empty
                            }
                        }
                    }
                }
            }
                );
            Group.AddRange(
                new Group()
            {
                Id    = 1,
                UseBy = Page.Find("root/gallery/100720infoExpr"),
                Page  = new[]
                {
                    Page.Find("root/gallery/100720infoExpr/0"),
                    Page.Find("root/gallery/100720infoExpr/1"),
                    Page.Find("root/gallery/100720infoExpr/2"),
                    Page.Find("root/gallery/100720infoExpr/3"),
                    Page.Find("root/gallery/100720infoExpr/4"),
                    Page.Find("root/gallery/100720infoExpr/5"),
                    Page.Find("root/gallery/100720infoExpr/6"),
                    Page.Find("root/gallery/100720infoExpr/7"),
                    Page.Find("root/gallery/100720infoExpr/8"),
                }
            },
                new Group()
            {
                Id    = 2,
                Title = "草",
                UseBy = Page.Find("root/gallery/100823takao"),
                Page  = new[]
                {
                    Page.Find("root/gallery/100823takao/0"),
                    Page.Find("root/gallery/100823takao/1"),
                    Page.Find("root/gallery/100823takao/2"),
                    Page.Find("root/gallery/100823takao/3"),
                    Page.Find("root/gallery/100823takao/4"),
                    Page.Find("root/gallery/100823takao/5"),
                    Page.Find("root/gallery/100823takao/6"),
                    Page.Find("root/gallery/100823takao/7"),
                    Page.Find("root/gallery/100823takao/8"),
                    Page.Find("root/gallery/100823takao/9"),
                }
            },
                new Group()
            {
                Id    = 3,
                Title = "木",
                UseBy = Page.Find("root/gallery/100823takao"),
                Page  = new[]
                {
                    Page.Find("root/gallery/100823takao/10"),
                    Page.Find("root/gallery/100823takao/11"),
                    Page.Find("root/gallery/100823takao/12"),
                    Page.Find("root/gallery/100823takao/13"),
                    Page.Find("root/gallery/100823takao/14"),
                }
            },
                new Group()
            {
                Id    = 4,
                Title = "他",
                UseBy = Page.Find("root/gallery/100823takao"),
                Page  = new[]
                {
                    Page.Find("root/gallery/100823takao/15"),
                    Page.Find("root/gallery/100823takao/16"),
                }
            }
                );
            RootPin.AddRange(
                new Pin()
            {
                Id    = 1,
                Title = Page.Find("root/gallery"),
                Page  = new[]
                {
                    Page.Find("root/gallery/100720infoExpr"),
                    Page.Find("root/gallery/100823takao"),
                }
            },
                new Pin()
            {
                Id    = 2,
                Title = Page.Find("root/product"),
                Page  = new[]
                {
                    Page.Find("root/product/snippet"),
                }
            }
                );
            ContentCard.AddRange(
                new ContentCard()
            {
                Order   = 0,
                Type    = CardType.Text,
                Title   = "this site...",
                Content = System.IO.File.ReadAllText($"{AppContext.BaseDirectory}Data/Files/sitedesc.html"),
                Owner   = Page.Find("root/about")
            },
                new ContentCard()
            {
                Order   = 1,
                Type    = CardType.Text,
                Title   = "namoshika's Profile",
                Content = System.IO.File.ReadAllText($"{AppContext.BaseDirectory}Data/Files/ownerdesc.html"),
                Owner   = Page.Find("root/about")
            },
                new ContentCard()
            {
                Order   = 2,
                Type    = CardType.Text,
                Title   = "サイト制作について",
                Content = System.IO.File.ReadAllText($"{AppContext.BaseDirectory}Data/Files/comment.html"),
                Owner   = Page.Find("root/about")
            },
                new ContentCard()
            {
                Order   = 0,
                Type    = CardType.Text,
                Title   = "パンくずリスト生成用PHP",
                Content = System.IO.File.ReadAllText($"{AppContext.BaseDirectory}Data/Files/breadcrumb.html"),
                Owner   = Page.Find("root/product/snippet")
            },
                new ContentCard()
            {
                Order   = 1,
                Type    = CardType.Text,
                Title   = "更新履歴生成用PHP",
                Content = System.IO.File.ReadAllText($"{AppContext.BaseDirectory}Data/Files/timeline.html"),
                Owner   = Page.Find("root/product/snippet")
            }
                );
            ContentInfoExpr.AddRange(
                new ContentInfoExpr()
            {
                Content = "<img class='picture' src='k05th_animalplant/anmlPlnt.jpg' alt='picture' />",
                Subject = "素材集の中から、植物と動物の形態・テクスチャーをよく観察し、お互いの相似な部分を見つけて、ひとつの新たな架空の生物として合成しなさい。あくまで植物と動物の色や形、テクスチャーなどの「似たところ」をうまく見立てて、両者を結びつけて自然に見えるように合成してください。合成に使用する素材は、植物1種類、動物1種類の2つとします。",
                Comment = "キャベツの葉の重なり具合がダチョウのモサモサに似ているように思えたため、合成しました。当初は、これは練習目的だったのですが、本命のトウモロコシと動物の皮膚の合成が出来の悪い模型の珍獣になってしまい、これを本番としました。合成において、艶のある物体の扱いが難しいというのは意外でした。",
                Owner   = Page.Find("root/gallery/100720infoExpr/0")
            },
                new ContentInfoExpr()
            {
                Content = "<embed class='picture' src='k06th_flashmotion/k6th.swf' width='320' height='228' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash'></embed>",
                Subject = "任意にテーマを選んでモーションガイドを利用したアニメーションを作成すること。具体的なモチーフを選び、それに相応しい自然な動きのアニメーションを作成してほしい。なお、ボタンを1つ作り、クリックするたびにアニメーションが見られるようにすること。",
                Comment = "モーショントゥーインの動きに魅せられて作りました。個人的には一番良く出来たかと思っています。課題自体はモーションガイドを使わなければならない課題であったため、どのようにモーションガイドが必要になる動きを組み込むかにとても悩みました。結果的に最後の水滴が小さい物体に衝突し、飛び散る動きで使用しましたが、そんなものはどうでもいいです。蛇口から水滴が出来、蛇口から離れるまでが全てです。",
                Owner   = Page.Find("root/gallery/100720infoExpr/1")
            },
                new ContentInfoExpr()
            {
                Content = "<embed class='picture' src='k07th_flashas/k07th.swf' width='320' height='245' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash'></embed>",
                Subject = "インタラクティブなFlashコンテンツを作成する。同じ場面で4つの異なる情況を各自で考えて撮影し、ON/OFFスイッチに合わせて4通りの画像が切り替わるようにすること。",
                Comment = "当初思いついたのは、頭皮が荒野となっている人の頭上を光らせるスイッチだったのですが、著作権やら名誉が云々で面倒だと思ったために色々考えた末、コンビニのおにぎりになりました。見どころは本来、剥がしたら戻せないはずの表面の包装がスイッチを切るだけで戻せる点です。現実じゃこうはいきません。普段趣味で使う開発環境はVisualStudioなのでFlashの開発環境のActionScriptの編集機能の貧弱さに戸惑いました。",
                Owner   = Page.Find("root/gallery/100720infoExpr/2")
            },
                new ContentInfoExpr()
            {
                Content = "<a href='k08th_html/contents/k08th.html' class='picture'><img class='picture' src='k08th_html/contentsSS.jpg' alt='picture' /></a>",
                Subject = "自分が興味・関心のある題材を用いて 、Web ページ(1ページだけでよい)を作成してください。",
                Comment = "課題が課された当時に着手していたデジタルデータ基礎のレポート課題の書きかけの形式が見出しやテーブル等で今回の課題で使う必要のあるタグに一致していたため、コピーせずして何がデジタルデータだと思いながら再利用しました。Wordの表をTableタグに移すのが大変でした。",
                Owner   = Page.Find("root/gallery/100720infoExpr/3")
            },
                new ContentInfoExpr()
            {
                Content = "<a href='k09th_htmlcss1/contents/k09th.html' class='picture'><img class='picture' src='k09th_htmlcss1/contentsSS.jpg' alt='picture' /></a>",
                Subject = "第8回目の課題の生成物を基にCSSを用いて Web ページに独自のスタイルを設定してください。",
                Comment = "授業で扱ったサンプル教材のCSSを参考にそのままやりました。特に感想は無い。",
                Owner   = Page.Find("root/gallery/100720infoExpr/4")
            },
                new ContentInfoExpr()
            {
                Content = "<a href='k10th_htmlcss2/contents/kadai_p1.html' class='picture'><img class='picture' src='k10th_htmlcss2/contentsSS.jpg' alt='picture' /></a>",
                Subject = "第9回目の課題で作成した Web ページにレイアウトを設定してください。",
                Comment = "IEのレンダリングエンジンのバグやCSSの珍仕様に度々遭遇し、ひどく疲弊しました。早くIEがインターネットから消えて欲しいと思うのは勿論、CSSの癖のある動きへもうんざりさせられました。仕様が統一されている面でFlashが素晴らしく思えました。",
                Owner   = Page.Find("root/gallery/100720infoExpr/5")
            },
                new ContentInfoExpr()
            {
                Content = "<a href='k11th_link/contents/links.html' class='picture'><img class='picture' src='k11th_link/contentsSS.jpg' alt='picture' /></a>",
                Subject = "あなたが是非みんなに教えてあげたいと思うお勧めのサイトを集めたリンク集を作って下さい。",
                Comment = "今回のウェブページを作る課題でも使えるCSSを書こうと思い、意気込んでデザインを作りました。意識した点としては使いまわしが効くようにclass設定を用いて各デザインの要素を性質ごとに分割しました。だいぶレンダリングエンジンのバグやCSSの珍仕様にも慣れたためにCSSに悩む事はだいぶ減りました。紹介しているサイトは自分のはてなブックマークから探しましたが、動画リンクサイト等が多かったために真面目なサイトを探すのに苦労しました。",
                Owner   = Page.Find("root/gallery/100720infoExpr/6")
            },
                new ContentInfoExpr()
            {
                Content = "<a href='k12th_web/contents/index.html' class='picture'><img class='picture' src='k12th_web/contentsSS.jpg' alt='picture' /></a>",
                Subject = "これまでの演習課題を掲載したWebページを作成する。なお、ページデザインはほぼ自由で各自の好みである。",
                Comment = "当サイトの初期ver1.0です。ver1.0まで掲載しろとは言われてませんが折角なので載せました。ただ、画像等が現バージョンと共有なので一部おかしいです。CSSが第11回の演習課題で作成したものを継承したために似ています。認識している問題点として、パンくずリストは途中で付け加えたために少々分かりずらいものとなってしまっています。そのため、現バージョンでは改善しました。また、この頃からCSSのLayoutとColorを別ファイルとして分離するようになったために容易にColorを全面変更する事が出来るようになりました。現バージョンでは汎用性の高い外見のLayoutとColorに1つ用意し、ページ共通のLayoutとColorに2つ。個別のページのLayoutとColorで2つに分けています。ちなみに夏季休暇課題で作成したver2.0は当然ver1.0のCSSを改良するはずで、休暇前にベースの大部分が既に出来ていたのですが、タギング方法を文章構造重視にした為に大部分が書きなおす事となり、現verは3.0とも言えます。",
                Owner   = Page.Find("root/gallery/100720infoExpr/7")
            },
                new ContentInfoExpr()
            {
                Content = "<a href='oop_js/contents/index.html' class='picture'><img class='picture' src='oop_js/contentsSS.jpg' alt='picture' /></a>",
                Subject = "授業で学んだことを活かして世界各国の首都の説明と場所を表示するページを作成してください。",
                Comment = "当時のコードは結合度の設計が甘かったため再構成したものを公開。JavaScriptの進化に合わせて今時な機能を使用してTypeScriptでまとめました。",
                Owner   = Page.Find("root/gallery/100720infoExpr/8")
            }
                );
            ContentTakao.AddRange(
                new ContentTakao()
            {
                Content = "<img src='dikn/image.jpg' class='picture' />",
                Comment = "登山の始めの方の沢に近づく道あたりでシダやらシャガに混じって見つけました。この植物は多年草で、耐寒性で冬は地上部を枯らす宿根性だそうです。各地の渓谷付近等のやや湿った場所に生え、7月~8月あたりに花を咲かせます。葉の形状が大根の葉に似ている事からこの名が名づけられて様ですが、大根がアブラナ科である一方、ダイコンソウはバラ科のため全く縁が無い感じです。また、自生種としてダイコンソウ属内でチングルマ等の同属が存在しますがダイコンソウ以外は高山に生える植物で、園芸種ではゲウムが同属です。花の先端にはフックの様な柱頭があり、服に引っかかる感じです。",
                Owner   = Page.Find("root/gallery/100823takao/0")
            },
                new ContentTakao()
            {
                Content = "<img src='gezi/image.jpg' class='picture' />",
                Comment = "琵琶滝までの道に沢山生えていました。この植物はゲジゲジみたいな葉の生え方からそう呼ばれているそうです。",
                Owner   = Page.Find("root/gallery/100823takao/1")
            },
                new ContentTakao()
            {
                Content = "<img src='hana/image.jpg' class='picture' />",
                Comment = "琵琶滝付近の沢に平行した道で見つけました。この植物は落葉性で低木で、5月~6月あたりに花を咲かせるそうです。特徴的な点として葉の中央に花を咲かせる点が挙げられ、8月時点では実になっていましたが見つけた時のインパクトは実でも十分でした(始めは別の植物が貫通しているのかと思いました)。名前の由来も葉をイカダに見立てたものだそうです。また、オスとメスの株があり、小学生時に育てたヘチマ以上に面倒な植物に思えます。写真撮影時には既に実の段階であったためにオスを見る事が出来ませんでしたが、メスの花は葉の上に通常1個出来るのに対し、オスの花は数個出来る様です。実は甘みがあり、食べられるそうです。",
                Owner   = Page.Find("root/gallery/100823takao/2")
            },
                new ContentTakao()
            {
                Content = "<img src='hebi/image.jpg' class='picture' />",
                Comment = "シダ&シャガに混じってましたが、野原や水田に生える多年草だそうです。これは自宅近くの小さい山でも見かけたりしますが、この植物は4月~6月あたりに黄色い5枚の花弁を持った花が咲くそうです。また、今まで有毒植物と思ってましたが違うようです。しかし、味が無く、不味いらしいです。また、名前の由来として蛇が食べるイチゴや蛇が獲物を狙うための餌代わり等言われているようですが良く分かりません。同属としてヤブヘビイチゴという種類があり、こちらはヘビイチゴよりも生える地域が限られており、実が赤く、光沢があり、林の縁等の光が少ない場所に生え、葉も色が濃いという違いがあるようですが、写真のがどっちかは分かりませんでした。",
                Owner   = Page.Find("root/gallery/100823takao/3")
            },
                new ContentTakao()
            {
                Content = "<img src='inod/image.jpg' class='picture' />",
                Comment = "ゲジゲジ等のシダに混じってシダの仲間のイノデが生えてました。シダにも種類がありますが、イノデ内でも複数の種類があり、シダ植物門オシダ科イノデ属と言う形でまとめられているのですが、その種類の中で雑種がどんどん出来るため、色々あるようです。ちなみに、そのどれに写真が属しているのかは良く分かりませんでした。名前の由来は新芽がイノシシの足のように毛むくじゃらな様子からそのように名付けられたようですが、確かに毛むくじゃらのようです(<a href=\"http://www.google.co.jp/images?q=%E3%82%A4%E3%83%8E%E3%83%87+%E6%96%B0%E8%8A%BD\" target=\"_blank\">Google</a>)。",
                Owner   = Page.Find("root/gallery/100823takao/4")
            },
                new ContentTakao()
            {
                Content = "<img src='ktne/image.jpg' class='picture' />",
                Comment = "これも琵琶滝までの道でシダの類に混じって生えており、ヤマキツネノボタンと言うそうです。日本各地に生えており、水田周辺の水路や溝、畦など、湿り気のある場所に生え、5月から7月あたりに花を咲かせる多年生の草本だそうです。花はかなり黄色いです。また、咲いた後に中央に出来る実は、複数の実が集合して出来ており、一つ一つの実には鍵状の突起が付いているために服に引っかかります。この果実の形状から、別名ではコンペイトウグサとも言うそうです。また、ヤマが抜けたキツネノボタンという種類もあり、ヤマの方が毛が多いそうです。違いが良く分かりませんが頂上のビジターセンターで紹介されていたのがヤマの方でしたし、山に生えていたので多分写真のはヤマの方なんでしょう。ちなみにトリカブト等、キンポウゲ科の植物には毒を持つものが多く、キツネノボタンも有毒植物だそうです。そのため、植物の汁に触れるとかぶれ、食べると消化器が炎症を起こします。よって、服に付いた実を包装材のプチプチみたく潰して遊ばないようにしましょう。",
                Owner   = Page.Find("root/gallery/100823takao/5")
            },
                new ContentTakao()
            {
                Content = "<img src='mizk/image.jpg' class='picture' />",
                Comment = "この植物は写真は撮ったのですが発見場所を忘れました。たぶんシャガ付近でしょう。写真に写ってますし。この植物は山の林縁や路傍に生える多年草で、8月~10月あたりに花を咲かせるそうです。花弁が無く、写真の赤く見えるのは\"がく\"だそうです。そして時期によって葉が八のような模様が付く様です。写真から分かるように、高さが30cm~80cmの茎に花が直接出てきています。また、種が服などにくっ付いて運ばれます。",
                Owner   = Page.Find("root/gallery/100823takao/6")
            },
                new ContentTakao()
            {
                Content = "<img src='myic/image.jpg' class='picture' />",
                Comment = "登り始めのシダの生えてる辺りで見つけました。この植物は山や川岸に生える常緑樹で、つる性の茎は地面を這い、棘を持つそうです。深山と書いてミヤマと読みますが、高尾山という低山に生えてしまう浅山苺です。9月~10月にかけて白い花を咲かせ、11月~1月あたりに赤い果実が実り、食べられるそうです。同属としてフユイチゴという似た種が有りますが、こちらは棘が無く、葉はミヤマフユイチゴよりも先端が丸くなっているそうですが、他は殆ど一緒どころか雑種まで出来てしまうために区別が難しかったりするようです。",
                Owner   = Page.Find("root/gallery/100823takao/7")
            },
                new ContentTakao()
            {
                Content = "<img src='shga/image.jpg' class='picture' />",
                Comment = "登山中盤までよく見かけた気がします。この植物はやや湿った場所に生える常緑性の多年草で、4月~5月あたりに花を咲かせるそうです。細長い光沢のある葉がいたる所で群生しており、山の斜面を支える事が役割があるそうです。8月に来たので当然花は有りませんでしたが、花は1日で萎んでしまい、種子は作らないそうです。この植物はどうやら中国から持ち込まれたものが野生化したものらしいです。",
                Owner   = Page.Find("root/gallery/100823takao/8")
            },
                new ContentTakao()
            {
                Content = "<img src='tama/image.jpg' class='picture' />",
                Comment = "数は多くないですが、山の上から下まで何処にでも生えてました。この植物は中部から関東までと福島県、岐阜県あたりに生えており、湿った場所に生える木で、7月~9月あたりに花を咲かせるそうです。良く知られている紫陽花は6月から7月あたりに花が咲くため、タマアジサイはかなり遅咲きと言えます。蕾の形が球体となっており、これが名前の由来となっています。また、写真からも分かりますが、一斉に花が咲く訳ではなく、順次球体が破れたように開いていきます。その為に余計に花を長期間見る事が出来るのと同時に、見た目が木全体で見た時にダサいです。知らなかったのですが、アジサイは当種も普通のも同様に有毒らしいです。カッコつけてカクテルに添えない様にしましょう。確か梅も同様の成分を含むので焼酎に漬ければ食えるかもしれません。",
                Owner   = Page.Find("root/gallery/100823takao/9")
            },
                new ContentTakao()
            {
                Content = "<img src='hono/image.jpg' class='picture' />",
                Comment = "琵琶滝までより前の道に生えていました。この木は落葉広葉樹で山地の河川等の土壌の厚い場所に生えている木で、5月~6月に花が咲くそうです。また、とても大きな葉を付ける木で、葉は20~40cm程の葉が付き、高尾山の植物の中では最も葉が大きい木です。そして幹が真っすぐに伸び、葉は上の方に付くために近くで葉を撮る事は出来ませんでした。木材としては上質でやわらかいために細工し易く、木細工や家具などに使われ、葉は殺菌作用があり、香りも良いために食べ物を包む際の食器代わりや、朴葉味噌への利用として活用され、樹皮は乾燥されて健胃薬として使われたりするそうです。葉の活用先として朴葉餅が有名だそうですが、これは柏餅に似ています。",
                Owner   = Page.Find("root/gallery/100823takao/10")
            },
                new ContentTakao()
            {
                Content = "<img src='momi/image.jpg' class='picture' />",
                Comment = "撮影場所を忘れましたが、けっこう何処にでも生えてますね。常緑針葉樹で日本の特産種で20m~30mの高さになり、木材は軽くてやわらかく、加工しやすいために建築や器具材、マッチの軸、パルプなどに利用されるそうです。しかし、大気汚染に弱く都市での栽培に向かないそうです。",
                Owner   = Page.Find("root/gallery/100823takao/11")
            },
                new ContentTakao()
            {
                Content = "<img src='sdzi/image.jpg' class='picture' />",
                Comment = "これも撮影場所忘れました。モミと同じく下山路に生えていました。常緑広葉樹林で葉は厚く深緑色。幹は黒褐色で、成長すると樹皮に縦の切れ目が入るのが特徴らしいです。ちなみに左上を見るとわかりますが、木にスダジイと名前が書いてあったので、この木は間違いなくスダジイです。他のは看板が架かってないので確信が持てなかったりします。",
                Owner   = Page.Find("root/gallery/100823takao/12")
            },
                new ContentTakao()
            {
                Content = "<img src='uraz/image.jpg' class='picture' />",
                Comment = "これも撮影場所忘れました。前のと同じく下山路です。樹皮は暗褐色から灰色で滑らか。高さは20cm以上に達します。葉の裏側が白色となっており、これが名前の由来となっています。この手の木の実が\"どんぐり\"と呼ばれるらしいですが、\"どんぐり\"が何者か考えた事が無かったのでへぇ~と思いました。",
                Owner   = Page.Find("root/gallery/100823takao/13")
            },
                new ContentTakao()
            {
                Content = "<img src='kago/image.jpg' class='picture' />",
                Comment = "これも撮影場所忘れました。前のと同じく下山路です。常緑樹で樹皮がまばらに剥がれ落ち、鹿の子模様になる点から「鹿子の木(かごのき)」と呼ばれています。8月~9月に花が咲くそうです。また、葉は特徴に欠け、葉のみで種を特定するのは難しいそうです。",
                Owner   = Page.Find("root/gallery/100823takao/14")
            },
                new ContentTakao()
            {
                Content = "<img src='neba/image.jpg' class='picture' />",
                Comment = "琵琶滝付近で露出していました。堆積岩の一種で、海底の砂や泥が自然の力で押し固められる事によって生成されるそうです。とても硬く、高密度できめ細かい構造をしており、薄く割れやすく風化しにくく、そして磨くと表面がツルツルになります。見る事が出来たのは黒色の粘板岩でしたが、赤や緑、紫色なのもあるそうです。主に瓦や堀、硯、囲碁の黒石などに利用されるそうです。",
                Owner   = Page.Find("root/gallery/100823takao/15")
            },
                new ContentTakao()
            {
                Content = "<img src='zato/image.jpg' class='picture' />",
                Comment = "琵琶滝以降の道で木の割れ目の間に2匹いました。この虫は中型の蜘蛛の仲間ですが、糸は出さず、頭胸部と腹部の間にくびれが無く、変わっています。この虫は身体が頭胸部と腹部の2つから構成されておらず、全て一個に収まっている点でダニっぽいです。そして、とにかく足が長く、この足の長さを活かして前方をゆさゆさと進んでいくため、気持ち悪いです。主に虫やその死骸を食べるため、頂上のビジターセンターでは森の掃除屋とされていました。視覚は明暗程度しか認識できないためにほぼ盲目といえ、視覚の代わりに周囲の振動を足で感知し、周囲を把握しているようです。まさに座頭虫と言えます。加えて、ザトウムシはピンチの時に足を自切するらしいです。なお、ザトウムシ目の中にも幾つか種類があるようですが写真のがどれに属すかはちょっと分かりませんでした。ちなみに「千と千尋の神隠し」で劇中に登場する「釜爺」のモデルはこれらしいです。釜爺も湯婆婆に絡まれた時に自切すれば湯屋でパシられる契約を結ばずに済んだのかもしれません。",
                Owner   = Page.Find("root/gallery/100823takao/16")
            }
                );
            UpdateHistory.AddRange(GetHistory());
            SaveChanges();
        }
Esempio n. 28
0
        private async Task <Episode> GetEpisodeUpdate(CrunchySession s, Episode placeholder, string datetime)
        {
            try
            {
                WebStream ws = await WebStream.Get(placeholder.PluginMetadata["Url"], null, LibSet[UserAgentS], null, s.cookies.ToCookieCollection(), SocketTimeout, true, null, _info.ProxyFromGlobalRequirements(_global));

                if (ws != null && ws.StatusCode == HttpStatusCode.OK)
                {
                    if (!VerifyLogin(ws.Cookies))
                    {
                        ws?.Dispose();
                        return(null);
                    }
                    StreamReader rd  = new StreamReader(ws);
                    string       dta = rd.ReadToEnd();
                    rd.Dispose();
                    Episodes eps = new Episodes();
                    eps.Items = new List <Episode>();
                    Show show = new Show();
                    show.PluginName = placeholder.PluginName;
                    show.Id         = placeholder.ShowId;

                    MatchCollection scol      = seasonregex.Matches(dta);
                    int             seasonnum = scol.Count;
                    if (scol.Count == 0)
                    {
                        AddEpisodes(eps, show, dta, String.Empty, 1, true);
                    }
                    else
                    {
                        Match sma = scol[0];
                        if (sma.Success)
                        {
                            string data      = sma.Value;
                            string seasoname = sma.Groups["season"].Value;
                            AddEpisodes(eps, show, data, seasoname, seasonnum, true);
                        }
                    }
                    if (eps.Items.Count == 0)
                    {
                        ws?.Dispose();
                        return(null);
                    }
                    Episode ep = eps.Items[0];
                    placeholder.PluginMetadata["Url"] = ep.PluginMetadata["Url"];
                    placeholder.ImageUri       = ep.ImageUri;
                    placeholder.Description    = ep.Description;
                    placeholder.EpisodeAlpha   = ep.EpisodeAlpha;
                    placeholder.EpisodeNumeric = ep.EpisodeNumeric;
                    placeholder.Id             = ep.Id;
                    placeholder.SeasonAlpha    = ep.SeasonAlpha;
                    placeholder.SeasonNumeric  = ep.SeasonNumeric;
                    placeholder.Name           = ep.Name;
                    placeholder.DateTime       = datetime;
                    UpdateHistory.Add(placeholder.UniqueTag, JsonConvert.SerializeObject(placeholder));
                    ws?.Dispose();
                    return(placeholder);
                }
            }
            catch (Exception)
            {
                return(null);
            }
            return(null);
        }
Esempio n. 29
0
        private async Task <UpdateResponse> Updates(CrunchySession s, ShowType t)
        {
            int            startpage = 0;
            UpdateResponse ret       = new UpdateResponse();
            bool           end       = false;

            do
            {
                string    url = string.Format(LibSet[UpdateUrlS], ShowFromType(t), startpage);
                WebStream ws  = await WebStream.Get(url, null, LibSet[UserAgentS], null, s.cookies.ToCookieCollection(), SocketTimeout, true, null, _info.ProxyFromGlobalRequirements(_global));

                if (ws != null && ws.StatusCode == HttpStatusCode.OK)
                {
                    if (!VerifyLogin(ws.Cookies))
                    {
                        ws.Dispose();
                        SetLoginError(ret);
                        return(ret);
                    }
                    StreamReader rd  = new StreamReader(ws);
                    string       dta = rd.ReadToEnd();
                    rd.Dispose();
                    MatchCollection scol = updregex.Matches(dta);
                    if (scol.Count == 0)
                    {
                        end = true;
                    }
                    foreach (Match m in scol)
                    {
                        string show  = m.Groups["show"].Value;
                        string image = m.Groups["image"].Value;
                        string title = WebUtility.HtmlDecode(m.Groups["title"].Value);
                        string ep    = m.Groups["ep"].Value;
                        Uri    ur    = new Uri("http://www.crunchyroll.com" + m.Groups["url"].Value);
                        int    a     = ep.IndexOf("&ndash;", StringComparison.InvariantCulture);
                        if (a >= 0)
                        {
                            ep = ep.Substring(0, a).Trim();
                            string tag = CrunchyPluginInfo.PluginName + "|" + show + "|" + ep;
                            if (UpdateHistory.Exists(tag))
                            {
                                Episode c = JsonConvert.DeserializeObject <Episode>(UpdateHistory.Get(tag));
                                ret.Found.Add(c);
                            }
                            else
                            {
                                Episode p = new Episode();
                                p.PluginMetadata.Add("Url", ur.ToString());
                                p.ShowName   = title;
                                p.ShowId     = show;
                                p.PluginName = CrunchyPluginInfo.PluginName;
                                p.UniqueTag  = tag;
                                p.ImageUri   = new Uri(image);
                                p.Type       = t;
                                ret.NotFound.Add(p);
                            }
                        }
                    }
                }
                else
                {
                    ws?.Dispose();
                    SetWebError(ret);
                    return(ret);
                }
                ws?.Dispose();
                startpage++;
            } while (!end);
            return(ret);
        }
Esempio n. 30
0
        public async Task <Updates> Updates(ISession session)
        {
            try
            {
                if (!UpdateHistory.IsLoaded)
                {
                    UpdateHistory.Load();
                }
                CrunchySession s = session as CrunchySession;
                if (s == null)
                {
                    return new Updates {
                               ErrorMessage = "Invalid Session", Status = ResponseStatus.InvalidArgument
                    }
                }
                ;

                Task <UpdateResponse> c1 = Updates(s, ShowType.Anime);
                Task <UpdateResponse> c2 = Updates(s, ShowType.Drama);
                Task <UpdateResponse> c3 = Updates(s, ShowType.Pop);
                await Task.WhenAll(c1, c2, c3);

                c3.Result.PropagateError(c2.Result);
                c2.Result.PropagateError(c1.Result);
                if (c1.Result.Status != ResponseStatus.Ok)
                {
                    Updates k = new Updates();

                    c1.Result.PropagateError(k);
                    return(k);
                }
                c1.Result.Found = c1.Result.Found.Concat(c2.Result.Found).Concat(c3.Result.Found).ToList();
                Episode[] nfnd =
                    c1.Result.NotFound.Concat(c2.Result.NotFound).Concat(c3.Result.NotFound).ToArray();
                Array.Reverse(nfnd);
                c1.Result.NotFound = nfnd.ToList();
                string datetime           = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
                List <Task <Episode> > ms = new List <Task <Episode> >();
                foreach (Episode m in c1.Result.NotFound)
                {
                    ms.Add(GetEpisodeUpdate(s, m, datetime));
                }
                if (ms.Count > 0)
                {
                    while (ms.Count > 0)
                    {
                        int max = 5;
                        if (ms.Count < 5)
                        {
                            max = ms.Count;
                        }
                        Task <Episode>[] tsks = new Task <Episode> [max];
                        for (int x = 0; x < max; x++)
                        {
                            tsks[x] = ms[0];
                            ms.Remove(ms[0]);
                        }
                        await Task.WhenAll(tsks);

                        for (int x = max - 1; x >= 0; x--)
                        {
                            if (tsks[x].Result != null)
                            {
                                c1.Result.Found.Add(tsks[x].Result);
                            }
                        }
                    }
                    UpdateHistory.Save();
                }
                Updates n = new Updates();
                n.Items = c1.Result.Found.ToList();
                int cnt = 1;
                foreach (Episode epu in n.Items)
                {
                    epu.Index = cnt++;
                }
                n.Status       = ResponseStatus.Ok;
                n.ErrorMessage = "OK";
                return(n);
            }
            catch (Exception e)
            {
                return(new Updates {
                    ErrorMessage = e.ToString(), Status = ResponseStatus.SystemError
                });
            }
        }