mAgicAnime 俺用改造版
Révision | 3280b495498199a3e508689bbb3ebd228ec3bdd6 (tree) |
---|---|
l'heure | 2016-10-30 07:52:20 |
Auteur | yoshy <yoshy@user...> |
Commiter | yoshy |
[UPDATE] 特番回のデータを通常回と分離して保持するように修正
[ADD] 放送プランデータ異常時に警告アイコンを表示する機能を追加
[ADD] 通常回・特番回末尾のデータが未定・異常時に削除する機能を追加
[ADD] 選択した番組のみデータ更新する機能を追加
@@ -31,8 +31,9 @@ namespace magicAnime | ||
31 | 31 | //========================================================================= |
32 | 32 | class SyoboiCalender |
33 | 33 | { |
34 | - // mod. yossiepon_20150705 | |
34 | + // add yossiepon 20150705 begin | |
35 | 35 | public const int UNNUMBERED_EPISODE = int.MinValue; |
36 | + // add yossiepon 20150705 end | |
36 | 37 | |
37 | 38 | DateTime? prevUpdateListGetTime = null; // 前回の更新リスト取得時刻 |
38 | 39 |
@@ -81,8 +82,9 @@ namespace magicAnime | ||
81 | 82 | //========================================================================= |
82 | 83 | public class SyoboiRecord : ICloneable |
83 | 84 | { |
84 | - // mod. yossiepon_20150705 | |
85 | + // add yossiepon 20150705 begin | |
85 | 86 | public string episode; |
87 | + // add yossiepon 20150705 end | |
86 | 88 | public int number; |
87 | 89 | public string subtitle; |
88 | 90 | public string tvStation; |
@@ -95,7 +97,7 @@ namespace magicAnime | ||
95 | 97 | return this.MemberwiseClone(); |
96 | 98 | } |
97 | 99 | |
98 | - // mod. yossiepon_20150705 begin | |
100 | + // add yossiepon 20150705 begin | |
99 | 101 | //========================================================================= |
100 | 102 | /// <summary> |
101 | 103 | /// フォーマットされた番組エピソード文字列を返す |
@@ -108,7 +110,7 @@ namespace magicAnime | ||
108 | 110 | { |
109 | 111 | return tvStation + "-No." + number + "(" + episode + ")「" + subtitle + "」(" + length + " min.)/" + onAirDateTime; |
110 | 112 | } |
111 | - // mod. yossiepon_20150705 end | |
113 | + // add yossiepon 20150705 end | |
112 | 114 | } |
113 | 115 | |
114 | 116 | public class SyoboiUpdate |
@@ -403,8 +405,10 @@ namespace magicAnime | ||
403 | 405 | Match matchTitle = parseTitle.Match(line); |
404 | 406 | |
405 | 407 | if( matchTitle.Success ) |
406 | - // mod. yossiepon_20150705 | |
408 | + // mod yossiepon 20150705 begin | |
409 | + // title = matchTitle.Groups["Title"].Value; | |
407 | 410 | title = HttpUtility.HtmlDecode( matchTitle.Groups["Title"].Value ); |
411 | + // mod yossiepon 20150705 end | |
408 | 412 | } |
409 | 413 | |
410 | 414 | allLine += line; |
@@ -447,6 +451,11 @@ namespace magicAnime | ||
447 | 451 | |
448 | 452 | source = lines; |
449 | 453 | |
454 | + // add yossiepon 20160808 begin | |
455 | + // 特番回に負の回数を符番する | |
456 | + NumberSpecialEpisodes(ref recordList); | |
457 | + // add yossiepon 20160808 end | |
458 | + | |
450 | 459 | return recordList; |
451 | 460 | } |
452 | 461 |
@@ -470,7 +479,7 @@ namespace magicAnime | ||
470 | 479 | ArrayList Cols; |
471 | 480 | string temp; |
472 | 481 | |
473 | - // mod. yossiepon_20150705 begin | |
482 | + // mod yossiepon 20150705 begin | |
474 | 483 | |
475 | 484 | List<decimal> dummyNums = new List<decimal>(); |
476 | 485 |
@@ -499,13 +508,13 @@ namespace magicAnime | ||
499 | 508 | // マッチした場合 |
500 | 509 | if (match.Success) |
501 | 510 | { |
502 | - // 最初と最後が端数だった場合、それぞれ1話増えるようにfloorとceilingにしておく | |
503 | - // ※中間に端数が含まれる場合、放送データからだけでは判別がつかず極めて稀なパターンと思われるので考慮しない | |
504 | 511 | decimal firstEpisode = Decimal.Parse(match.Groups["FirstEpisode"].Value); |
505 | 512 | decimal lastEpisode = Decimal.Parse(match.Groups["LastEpisode"].Value); |
506 | 513 | |
507 | 514 | // 連続話数は分割せずにまとめて録画する |
508 | - syoboiRecord.episode = firstEpisode + "〜" + lastEpisode; // 話番号文字列(マッチ結果全体をそのまま入れる) | |
515 | + | |
516 | + // 話番号文字列(マッチ結果全体をそのまま入れる) | |
517 | + syoboiRecord.episode = formatEpisodeNo(firstEpisode) + "〜" + formatEpisodeNo(lastEpisode); | |
509 | 518 | syoboiRecord.number = convertDecimalEpisodeNoToInt(firstEpisode); // 話番号(1つ目) |
510 | 519 | |
511 | 520 | // HTMLエンコード文字をデコード |
@@ -519,8 +528,8 @@ namespace magicAnime | ||
519 | 528 | } |
520 | 529 | |
521 | 530 | // 最初の話数から最後の話数までをダミー話数リストに追加する |
522 | - // 最後の話数が端数の場合は、その前までが追加される | |
523 | - for(int i = Decimal.ToInt32(Decimal.Ceiling(firstEpisode)); i <= Decimal.ToInt32(Decimal.Floor(lastEpisode)); i++) | |
531 | + // 最初の話数が端数の場合はその次から、最後の話数が端数の場合はその前までが追加される | |
532 | + for (int i = Decimal.ToInt32(Decimal.Ceiling(firstEpisode)); i <= Decimal.ToInt32(Decimal.Floor(lastEpisode)); i++) | |
524 | 533 | { |
525 | 534 | dummyNums.Add(i); |
526 | 535 | } |
@@ -593,7 +602,7 @@ namespace magicAnime | ||
593 | 602 | // 連番の場合、「nn〜mm」にする |
594 | 603 | if ( isEntireNums ) |
595 | 604 | { |
596 | - episodeStr = firstEpisode + "〜" + lastEpisode; | |
605 | + episodeStr = formatEpisodeNo(firstEpisode) + "〜" + formatEpisodeNo(lastEpisode); | |
597 | 606 | } |
598 | 607 | } |
599 | 608 |
@@ -608,7 +617,7 @@ namespace magicAnime | ||
608 | 617 | { |
609 | 618 | episodeStrBuf.Append('、'); |
610 | 619 | } |
611 | - episodeStrBuf.Append(dummyNums[i]); | |
620 | + episodeStrBuf.Append(formatEpisodeNo(dummyNums[i])); | |
612 | 621 | } |
613 | 622 | |
614 | 623 | episodeStr = episodeStrBuf.ToString(); |
@@ -635,8 +644,17 @@ namespace magicAnime | ||
635 | 644 | } |
636 | 645 | else |
637 | 646 | { |
638 | - syoboiRecord.number = convertDecimalEpisodeNoToInt( decimal.Parse( (string)Cols[ 3 ] ) ); // 話番号 | |
639 | - syoboiRecord.episode = syoboiRecord.number.ToString(Settings.Default.storyNoFormat); // 話番号文字列 | |
647 | + decimal storyNo = decimal.Parse((string)Cols[3]); | |
648 | + syoboiRecord.number = convertDecimalEpisodeNoToInt(storyNo); // 話番号 | |
649 | + if (storyNo != decimal.Zero) | |
650 | + { | |
651 | + syoboiRecord.episode = formatEpisodeNo(syoboiRecord.number); // 話番号文字列 | |
652 | + } | |
653 | + else | |
654 | + { | |
655 | + // 0話で話番号が振られているケースの場合 | |
656 | + syoboiRecord.episode = formatEpisodeNo(storyNo); // 話番号文字列 | |
657 | + } | |
640 | 658 | |
641 | 659 | // HTMLエンコード文字をデコード |
642 | 660 | syoboiRecord.subtitle = HttpUtility.HtmlDecode( MakeNaked( (string)Cols[ 4 ] ) ); // サブタイトル |
@@ -661,7 +679,7 @@ namespace magicAnime | ||
661 | 679 | recordList.Add(newRecord); |
662 | 680 | } |
663 | 681 | |
664 | - // mod. yossiepon_20150705 end | |
682 | + // mod yossiepon 20150705 end | |
665 | 683 | } |
666 | 684 | catch(Exception) |
667 | 685 | { |
@@ -813,7 +831,7 @@ namespace magicAnime | ||
813 | 831 | { |
814 | 832 | string nakedContext = context; |
815 | 833 | |
816 | - // mod. yossiepon_20150705 begin | |
834 | + // add yossiepon 20150705 begin | |
817 | 835 | { |
818 | 836 | Regex regex = new Regex("<div class=\"peComment\">(?<Content>(.*?))</div>"); |
819 | 837 | Match match = regex.Match(nakedContext); |
@@ -835,7 +853,7 @@ namespace magicAnime | ||
835 | 853 | nakedContext = regex.Replace(nakedContext, content); |
836 | 854 | } |
837 | 855 | } |
838 | - // mod. yossiepon_20150705 end | |
856 | + // add yossiepon 20150705 end | |
839 | 857 | |
840 | 858 | { |
841 | 859 | Regex regex = new Regex("<a(.*?)>(?<Content>(.*?))</a>"); |
@@ -863,8 +881,21 @@ namespace magicAnime | ||
863 | 881 | } |
864 | 882 | } |
865 | 883 | |
866 | - // mod. yossiepon_20150705 | |
867 | - return nakedContext.Trim(); | |
884 | + // mod yossiepon 20160924 begin | |
885 | + // // mod yossiepon 20150705 begin | |
886 | + // // return nakedContext; | |
887 | + // return nakedContext.Trim(); | |
888 | + // // mod yossiepon 20150705 end | |
889 | + | |
890 | + nakedContext = nakedContext.Trim(); | |
891 | + // 特番回に含まれる先頭の「^」があれば除去する | |
892 | + if ((nakedContext.Length > 0) && (nakedContext[0] == '^')) | |
893 | + { | |
894 | + nakedContext = nakedContext.Substring(1); | |
895 | + } | |
896 | + | |
897 | + return nakedContext; | |
898 | + // mod yossiepon 20160924 end | |
868 | 899 | } |
869 | 900 | |
870 | 901 | //========================================================================= |
@@ -945,57 +976,38 @@ namespace magicAnime | ||
945 | 976 | } |
946 | 977 | |
947 | 978 | |
979 | + // add yossiepon 20160808 begin | |
948 | 980 | //========================================================================= |
949 | 981 | /// <summary> |
950 | - /// 未対応話を最終話以降に連結する | |
982 | + /// 特番回に負の話数を符番する | |
951 | 983 | /// </summary> |
952 | 984 | /// <remarks> |
953 | 985 | /// </remarks> |
954 | 986 | /// <history>2006/XX/XX 新規作成</history> |
955 | 987 | //========================================================================= |
956 | - static public int Unnumbers( string _tvstasion, ref List<SyoboiCalender.SyoboiRecord> _syoboi) | |
988 | + private void NumberSpecialEpisodes(ref List<SyoboiCalender.SyoboiRecord> syoboi) | |
957 | 989 | { |
958 | - // mod. yossiepon_20150705 begin | |
990 | + ArrayList tvStationList = ListupTvStation(syoboi); | |
959 | 991 | |
960 | - int maxEpNo = int.MinValue; | |
961 | - int curSpEpNo = 1; | |
992 | + foreach (string tvStation in tvStationList) { | |
962 | 993 | |
963 | - Dictionary<string, int> specialEpNos = new Dictionary<string, int>(); | |
994 | + int curSpEpNo = -1; | |
964 | 995 | |
965 | - // 放送分の最大話数を取得 | |
966 | - for(int i = 0; i < _syoboi.Count; i++) | |
967 | - { | |
968 | - if (_syoboi[i].tvStation.Equals(_tvstasion)) | |
969 | - { | |
970 | - int epNo = _syoboi[i].number; | |
971 | - | |
972 | - if(epNo != UNNUMBERED_EPISODE) | |
973 | - { | |
974 | - maxEpNo = Math.Max(maxEpNo, epNo); | |
975 | - } | |
976 | - } | |
977 | - } | |
978 | - | |
979 | - // 最大話数が見つからない場合(すべて未付番の場合) | |
980 | - if(maxEpNo == int.MinValue) | |
981 | - { | |
982 | - // 特別編の話数を1から付番する | |
983 | - maxEpNo = 0; | |
984 | - } | |
996 | + Dictionary<string, int> specialEpNos = new Dictionary<string, int>(); | |
985 | 997 | |
986 | - // 特別編に話数を振る | |
987 | - for(int i = 0; i < _syoboi.Count; i++) | |
998 | + // 特番回に話数を振る | |
999 | + for (int i = 0; i < syoboi.Count; i++) | |
988 | 1000 | { |
989 | - if (_syoboi[i].tvStation.Equals(_tvstasion)) | |
1001 | + if (syoboi[i].tvStation.Equals(tvStation)) | |
990 | 1002 | { |
991 | - int epNo = _syoboi[i].number; | |
992 | - string subtitle = _syoboi[i].subtitle; | |
1003 | + int epNo = syoboi[i].number; | |
1004 | + string subtitle = syoboi[i].subtitle; | |
993 | 1005 | |
994 | - // 話数が特別編(UNNUMBERED_EPISODE)なら | |
1006 | + // 話数が特番回(UNNUMBERED_EPISODE)なら | |
995 | 1007 | if (epNo == UNNUMBERED_EPISODE) |
996 | 1008 | { |
997 | 1009 | // 特別編の話数がディクショナリに存在したら |
998 | - if ( specialEpNos.ContainsKey(subtitle) ) | |
1010 | + if (specialEpNos.ContainsKey(subtitle)) | |
999 | 1011 | { |
1000 | 1012 | // 保存済みの話数を使用する |
1001 | 1013 | epNo = specialEpNos[subtitle]; |
@@ -1003,29 +1015,26 @@ namespace magicAnime | ||
1003 | 1015 | else |
1004 | 1016 | { |
1005 | 1017 | // 存在しなければ、新しい話数を発番して保存する |
1006 | - epNo = maxEpNo + curSpEpNo ++; | |
1018 | + epNo = curSpEpNo--; | |
1007 | 1019 | specialEpNos.Add(subtitle, epNo); |
1008 | 1020 | } |
1009 | 1021 | |
1010 | 1022 | // 話数文字列が振られていなければ「SPn」にする |
1011 | - if(_syoboi[i].episode.Length == 0) | |
1023 | + if (syoboi[i].episode.Length == 0) | |
1012 | 1024 | { |
1013 | - _syoboi[i].episode = Settings.Default.unnumberedEpisodePrefix + (epNo - maxEpNo); | |
1025 | + syoboi[i].episode = Settings.Default.unnumberedEpisodePrefix + (-epNo); | |
1014 | 1026 | } |
1015 | 1027 | |
1016 | - // 特別編に話数をつける | |
1017 | - _syoboi[i].number = epNo; | |
1028 | + // 特番回に話数をつける | |
1029 | + syoboi[i].number = epNo; | |
1030 | + } | |
1018 | 1031 | } |
1019 | 1032 | } |
1020 | 1033 | } |
1021 | - | |
1022 | - // 付番した最大話数を返す | |
1023 | - return maxEpNo + curSpEpNo - 1; | |
1024 | - | |
1025 | - // mod. yossiepon_20150705 end | |
1026 | 1034 | } |
1035 | + // add yossiepon 20160808 end | |
1027 | 1036 | |
1028 | - // mod. yossiepon_20150705 begin | |
1037 | + // add yossiepon 20150705 begin | |
1029 | 1038 | //========================================================================= |
1030 | 1039 | /// <summary> |
1031 | 1040 | /// 話番号を整数に変換する |
@@ -1049,8 +1058,21 @@ namespace magicAnime | ||
1049 | 1058 | // 端数でなければ整数なので、そのまま変換して返す |
1050 | 1059 | return Decimal.ToInt32(no); |
1051 | 1060 | } |
1052 | - // mod. yossiepon_20150705 end | |
1053 | - | |
1061 | + // add yossiepon 20150705 end | |
1062 | + | |
1063 | + // add yossiepon 20160924 begin | |
1064 | + //========================================================================= | |
1065 | + /// <summary> | |
1066 | + /// 話数に書式を適用する | |
1067 | + /// </summary> | |
1068 | + /// <param name="no">話番号(実数)</param> | |
1069 | + /// <returns>書式を適用した話数文字列</returns> | |
1070 | + //========================================================================= | |
1071 | + private String formatEpisodeNo(decimal no) | |
1072 | + { | |
1073 | + return no.ToString(Settings.Default.storyNoFormat); | |
1074 | + } | |
1075 | + // add yossiepon 20160924 end | |
1054 | 1076 | |
1055 | 1077 | } |
1056 | 1078 |
@@ -33,10 +33,10 @@ namespace Helpers | ||
33 | 33 | name = name.Replace( ':', ':' ); |
34 | 34 | name = name.Replace( ':', ':' ); |
35 | 35 | name = name.Replace( '\"', '”' ); |
36 | -// mod. yossiepon_20151025 begin | |
36 | + // add yossiepon 20151025 begin | |
37 | 37 | name = name.Replace( '|', '|' ); |
38 | 38 | name = name.Replace( '%', '%' ); |
39 | -// mod. yossiepon_20151025 end | |
39 | + // add yossiepon 20151025 end | |
40 | 40 | |
41 | 41 | // 無効な文字を削除する |
42 | 42 | name = name.TrimStart( Path.GetInvalidFileNameChars() ); |
@@ -5,11 +5,11 @@ using System.Runtime.InteropServices; | ||
5 | 5 | // アセンブリに関する一般情報は以下の属性セットをとおして制御されます。 |
6 | 6 | // アセンブリに関連付けられている情報を変更するには、 |
7 | 7 | // これらの属性値を変更してください。 |
8 | -[assembly: AssemblyTitle("mAgicAnime Ver.7sh mod. yossiepon_20151025")] | |
8 | +[assembly: AssemblyTitle("mAgicAnime Ver.7sh mod. yossiepon_20160924")] | |
9 | 9 | [assembly: AssemblyDescription("")] |
10 | 10 | [assembly: AssemblyConfiguration("")] |
11 | 11 | [assembly: AssemblyCompany("")] |
12 | -[assembly: AssemblyProduct("mAgicAnime.NET (ななし版, mod. yossiepon_20151025)")] | |
12 | +[assembly: AssemblyProduct("mAgicAnime.NET (ななし版, mod. yossiepon_20160924)")] | |
13 | 13 | [assembly: AssemblyCopyright("Copyright (C) 2006-2010 mAgicAnime Project")] |
14 | 14 | [assembly: AssemblyTrademark("")] |
15 | 15 | [assembly: AssemblyCulture("")] |
@@ -30,4 +30,4 @@ using System.Runtime.InteropServices; | ||
30 | 30 | // Revision |
31 | 31 | // |
32 | 32 | [assembly: AssemblyVersion("2.0.0.0")] |
33 | -[assembly: AssemblyFileVersion("2.0.14.20151025")] | |
33 | +[assembly: AssemblyFileVersion("2.0.14.20160924")] |
@@ -97,8 +97,9 @@ namespace magicAnime | ||
97 | 97 | public string mSubTitle = ""; // サブタイトル |
98 | 98 | private bool mIsDirty = false; // データ変更フラグ |
99 | 99 | private int mStoryNumber = 0; // エピソード番号 |
100 | - // mod. yossiepon_20150705 | |
100 | + // add yossiepon 20150705 begin | |
101 | 101 | private string mStoryNoStr = ""; // エピソード番号文字列 |
102 | + // add yossiepon 20150705 end | |
102 | 103 | private int mRepeatNumber = -1; // n回目の放送 |
103 | 104 | private bool mPlanError = false; // 放送プランデータ異常 |
104 | 105 |
@@ -451,8 +452,9 @@ namespace magicAnime | ||
451 | 452 | } |
452 | 453 | |
453 | 454 | public int StoryNumber { get { return mStoryNumber; } } |
454 | - // mod. yossiepon_20150705 | |
455 | + // add yossiepon 20150705 begin | |
455 | 456 | public string StoryNoStr { get { return mStoryNoStr; } } |
457 | + // add yossiepon 20150705 end | |
456 | 458 | |
457 | 459 | //========================================================================= |
458 | 460 | /// <summary> |
@@ -644,15 +646,19 @@ namespace magicAnime | ||
644 | 646 | if( !mHasPlan |
645 | 647 | || (mStartTime != syoboiRecord.onAirDateTime) |
646 | 648 | || (mLength != syoboiRecord.length) |
647 | - // mod. yossiepon_20150705 | |
649 | + // add yossiepon 20150705 begin | |
648 | 650 | || !mStoryNoStr.Equals(syoboiRecord.episode) ) |
651 | + // add yossiepon 20150705 end | |
649 | 652 | { |
650 | - // mod. yossiepon_20150705 | |
653 | + // mod yossiepon 20150705 begin | |
654 | + // mHasPlan = true; | |
651 | 655 | mHasPlan = syoboiRecord.length != 0; |
656 | + // mod yossiepon 20150705 end | |
652 | 657 | mStartTime = syoboiRecord.onAirDateTime; |
653 | 658 | mLength = syoboiRecord.length; |
654 | - // mod. yossiepon_20150705 | |
659 | + // add yossiepon 20150705 begin | |
655 | 660 | mStoryNoStr = syoboiRecord.episode; |
661 | + // add yossiepon 20150705 begin | |
656 | 662 | Dirty = true; |
657 | 663 | } |
658 | 664 |
@@ -1262,10 +1268,11 @@ namespace magicAnime | ||
1262 | 1268 | subTitleName, |
1263 | 1269 | dateStr, |
1264 | 1270 | timeStr, |
1265 | - // mod. yossiepon_20150705 begin | |
1271 | + // mod yossiepon 20150705 begin | |
1272 | + // station); | |
1266 | 1273 | station, |
1267 | 1274 | mStoryNoStr.Length > 0 ? mStoryNoStr : mStoryNumber.ToString(Settings.Default.storyNoFormat)); |
1268 | - // mod. yossiepon_20150705 end | |
1275 | + // mod yossiepon 20150705 end | |
1269 | 1276 | } |
1270 | 1277 | catch(Exception ex) |
1271 | 1278 | { |
@@ -1312,10 +1319,11 @@ namespace magicAnime | ||
1312 | 1319 | mSubTitle, |
1313 | 1320 | dateStr, |
1314 | 1321 | timeStr, |
1315 | - // mod. yossiepon_20150705 begin | |
1322 | + // mod yossiepon 20150705 begin | |
1323 | + // station); | |
1316 | 1324 | station, |
1317 | 1325 | mStoryNoStr.Length > 0 ? mStoryNoStr : mStoryNumber.ToString(Settings.Default.storyNoFormat)); |
1318 | - // mod. yossiepon_20150705 end | |
1326 | + // mod yossiepon 20150705 end | |
1319 | 1327 | } |
1320 | 1328 | catch(Exception ex) |
1321 | 1329 | { |
@@ -1505,8 +1513,9 @@ namespace magicAnime | ||
1505 | 1513 | xw.WriteStartElement("Records"); |
1506 | 1514 | |
1507 | 1515 | xw.WriteElementString("StoryNumber" , Convert.ToString(mStoryNumber)); |
1508 | - // mod. yossiepon_20150705 | |
1516 | + // add yossiepon 20150705 begin | |
1509 | 1517 | xw.WriteElementString("StoryNoStr" , mStoryNoStr); |
1518 | + // add yossiepon 20150705 end | |
1510 | 1519 | xw.WriteElementString("FilePath" , mFilePath); |
1511 | 1520 | xw.WriteElementString("DateTime" , Convert.ToString(mStartTime.Ticks)); |
1512 | 1521 | xw.WriteElementString("SubTitle" , mSubTitle); |
@@ -1544,9 +1553,10 @@ namespace magicAnime | ||
1544 | 1553 | { |
1545 | 1554 | if (xr.LocalName.Equals("StoryNumber")) |
1546 | 1555 | mStoryNumber = xr.ReadElementContentAsInt(); |
1547 | - // mod. yossiepon_20150705 | |
1556 | + // add yossiepon 20150705 begin | |
1548 | 1557 | else if (xr.LocalName.Equals("StoryNoStr")) |
1549 | 1558 | mStoryNoStr = xr.ReadElementContentAsString(); |
1559 | + // add yossiepon 20150705 end | |
1550 | 1560 | else if (xr.LocalName.Equals("FilePath")) |
1551 | 1561 | mFilePath = xr.ReadElementContentAsString(); |
1552 | 1562 | // Ver1.9.18以前からの以降 |
@@ -1589,12 +1599,12 @@ namespace magicAnime | ||
1589 | 1599 | break; |
1590 | 1600 | } |
1591 | 1601 | |
1592 | - // mod. yossiepon_20150705 begin | |
1602 | + // add yossiepon 20150705 begin | |
1593 | 1603 | if (mStoryNoStr.Length == 0) |
1594 | 1604 | { |
1595 | 1605 | mStoryNoStr = mStoryNumber.ToString(Settings.Default.storyNoFormat); |
1596 | 1606 | } |
1597 | - // mod. yossiepon_20150705 end | |
1607 | + // add yossiepon 20150705 end | |
1598 | 1608 | } |
1599 | 1609 | |
1600 | 1610 | // Ver1.9.18以前からのデータ移行用 |
@@ -67,6 +67,9 @@ namespace magicAnime | ||
67 | 67 | public string filterKeyword = ""; // フィルタ文字列 |
68 | 68 | |
69 | 69 | private int mStoryCount; |
70 | + // add yossiepon 20160806 begin | |
71 | + private int mSpecialStoryCount; | |
72 | + // add yossiepon 20160806 end | |
70 | 73 | private uint mHashCode = 0; |
71 | 74 | private AnimeServer mParent; |
72 | 75 | private bool mIsDirty = false; // 変更フラグ |
@@ -74,7 +77,10 @@ namespace magicAnime | ||
74 | 77 | private List<Scheduler.Profile> mSchedulerProfiles; |
75 | 78 | private Type mEncoderType = null; // エンコーダクラスのType |
76 | 79 | private EncodeProfile mEncoderProfile = null; // エンコーダ設定 |
77 | - private EpisodeList mEpisodes; // この番組の各話(Episode)の集合 | |
80 | + private EpisodeList mEpisodes; // この番組の符番された各話(Episode)の集合 | |
81 | + // add yossiepon 20160806 begin | |
82 | + private EpisodeList mSpecialEpisodes; // この番組の符番されていない各話(Episode)の集合 | |
83 | + // add yossiepon 20160806 end | |
78 | 84 | private Mutex mEpisodeLock = new Mutex(); |
79 | 85 | private DateTime mLastUpdate; // データーベースからの最終更新時刻 |
80 | 86 | private Image mThambnailImage = null; |
@@ -136,6 +142,10 @@ namespace magicAnime | ||
136 | 142 | mEpisodeLock.WaitOne(); |
137 | 143 | foreach (AnimeEpisode episode in mEpisodes) |
138 | 144 | childDirty |= episode.Dirty; |
145 | + // add yossiepon 20160806 begin | |
146 | + foreach (AnimeEpisode episode in mSpecialEpisodes) | |
147 | + childDirty |= episode.Dirty; | |
148 | + // add yossiepon 20160806 end | |
139 | 149 | } |
140 | 150 | finally |
141 | 151 | { |
@@ -153,6 +163,10 @@ namespace magicAnime | ||
153 | 163 | mEpisodeLock.WaitOne(); |
154 | 164 | foreach (AnimeEpisode episode in mEpisodes) |
155 | 165 | episode.Dirty = false; |
166 | + // add yossiepon 20160806 begin | |
167 | + foreach (AnimeEpisode episode in mSpecialEpisodes) | |
168 | + episode.Dirty = false; | |
169 | + // add yossiepon 20160806 end | |
156 | 170 | } |
157 | 171 | finally |
158 | 172 | { |
@@ -216,6 +230,61 @@ namespace magicAnime | ||
216 | 230 | } |
217 | 231 | } |
218 | 232 | |
233 | + // add yossiepon 20160806 begin | |
234 | + //========================================================================= | |
235 | + /// <summary> | |
236 | + /// 話数の取得と変更 | |
237 | + /// </summary> | |
238 | + /// <remarks> | |
239 | + /// </remarks> | |
240 | + /// <history>2006/XX/XX 新規作成</history> | |
241 | + //========================================================================= | |
242 | + public int SpecialStoryCount | |
243 | + { | |
244 | + get { return mSpecialStoryCount; } | |
245 | + set | |
246 | + { | |
247 | + int i; | |
248 | + | |
249 | + try | |
250 | + { | |
251 | + mEpisodeLock.WaitOne(); | |
252 | + | |
253 | + this.mIsDirty = true; | |
254 | + | |
255 | + if (mSpecialEpisodes == null) | |
256 | + { | |
257 | + mSpecialEpisodes = new EpisodeList(); | |
258 | + } | |
259 | + | |
260 | + //----------------------------------- | |
261 | + // Episodeリストを話数にあわせて拡大 | |
262 | + //----------------------------------- | |
263 | + if (mSpecialStoryCount < value) | |
264 | + { | |
265 | + for (i = mSpecialStoryCount; i < value; ++i) | |
266 | + { | |
267 | + mSpecialEpisodes.Add(new AnimeEpisode(this, -(i + 1))); | |
268 | + } | |
269 | + } | |
270 | + else | |
271 | + { | |
272 | + for (i = mSpecialStoryCount; value < i; --i) | |
273 | + { | |
274 | + mSpecialEpisodes.RemoveAt(i - 1); | |
275 | + } | |
276 | + } | |
277 | + | |
278 | + mSpecialStoryCount = value; | |
279 | + } | |
280 | + finally | |
281 | + { | |
282 | + mEpisodeLock.ReleaseMutex(); | |
283 | + } | |
284 | + } | |
285 | + } | |
286 | + // add yossiepon 20160806 end | |
287 | + | |
219 | 288 | //========================================================================= |
220 | 289 | /// <summary> |
221 | 290 | /// 番組ごとの録画設定 |
@@ -328,8 +397,45 @@ namespace magicAnime | ||
328 | 397 | |
329 | 398 | EpisodeList coppied = new EpisodeList(); |
330 | 399 | |
331 | - foreach( AnimeEpisode ep in mEpisodes ) | |
332 | - coppied.Add( ep ); | |
400 | + foreach (AnimeEpisode ep in mEpisodes) | |
401 | + coppied.Add(ep); | |
402 | + // add yossiepon 20160806 begin | |
403 | + foreach (AnimeEpisode ep in mSpecialEpisodes) | |
404 | + coppied.Add(ep); | |
405 | + // add yossiepon 20160806 end | |
406 | + | |
407 | + return coppied; | |
408 | + } | |
409 | + finally | |
410 | + { | |
411 | + mEpisodeLock.ReleaseMutex(); | |
412 | + } | |
413 | + } | |
414 | + } | |
415 | + | |
416 | + // add yossiepon 20160924 begin | |
417 | + //========================================================================= | |
418 | + /// <summary> | |
419 | + /// 通常エピソードのリストを返す | |
420 | + /// </summary> | |
421 | + /// <remarks> | |
422 | + /// リストオブジェクトのコピーを返す。 | |
423 | + /// 上位がリストを変更してもこちらのデータに影響しない。 | |
424 | + /// </remarks> | |
425 | + /// <history>2006/XX/XX 新規作成</history> | |
426 | + //========================================================================= | |
427 | + public EpisodeList NormalEpisodes | |
428 | + { | |
429 | + get | |
430 | + { | |
431 | + try | |
432 | + { | |
433 | + mEpisodeLock.WaitOne(); | |
434 | + | |
435 | + EpisodeList coppied = new EpisodeList(); | |
436 | + | |
437 | + foreach (AnimeEpisode ep in mEpisodes) | |
438 | + coppied.Add(ep); | |
333 | 439 | |
334 | 440 | return coppied; |
335 | 441 | } |
@@ -342,6 +448,39 @@ namespace magicAnime | ||
342 | 448 | |
343 | 449 | //========================================================================= |
344 | 450 | /// <summary> |
451 | + /// 特番エピソードのリストを返す | |
452 | + /// </summary> | |
453 | + /// <remarks> | |
454 | + /// リストオブジェクトのコピーを返す。 | |
455 | + /// 上位がリストを変更してもこちらのデータに影響しない。 | |
456 | + /// </remarks> | |
457 | + /// <history>2006/XX/XX 新規作成</history> | |
458 | + //========================================================================= | |
459 | + public EpisodeList SpecialEpisodes | |
460 | + { | |
461 | + get | |
462 | + { | |
463 | + try | |
464 | + { | |
465 | + mEpisodeLock.WaitOne(); | |
466 | + | |
467 | + EpisodeList coppied = new EpisodeList(); | |
468 | + | |
469 | + foreach (AnimeEpisode ep in mSpecialEpisodes) | |
470 | + coppied.Add(ep); | |
471 | + | |
472 | + return coppied; | |
473 | + } | |
474 | + finally | |
475 | + { | |
476 | + mEpisodeLock.ReleaseMutex(); | |
477 | + } | |
478 | + } | |
479 | + } | |
480 | + // add yossiepon 20160924 end | |
481 | + | |
482 | + //========================================================================= | |
483 | + /// <summary> | |
345 | 484 | /// 番組固有IDを返す |
346 | 485 | /// </summary> |
347 | 486 | /// <remarks> |
@@ -492,24 +631,25 @@ namespace magicAnime | ||
492 | 631 | } |
493 | 632 | } |
494 | 633 | |
495 | - | |
496 | - //========================================================================= | |
497 | - /// <summary> | |
498 | - /// 第n話のエピソードを取得する(1〜) | |
499 | - /// </summary> | |
500 | - /// <remarks> | |
501 | - /// </remarks> | |
502 | - /// <history>2006/XX/XX 新規作成</history> | |
503 | - //========================================================================= | |
504 | - public AnimeEpisode this[int storyNumber] | |
505 | - { | |
506 | - get | |
507 | - { | |
508 | - if (storyNumber < 1 || mStoryCount < storyNumber) | |
509 | - throw new Exception("内部エラー: 話数が範囲外です"); | |
510 | - return (AnimeEpisode)mEpisodes[storyNumber - 1]; | |
511 | - } | |
512 | - } | |
634 | + // del yossiepon 20160806 begin | |
635 | + ////========================================================================= | |
636 | + ///// <summary> | |
637 | + ///// 第n話のエピソードを取得する(1〜) | |
638 | + ///// </summary> | |
639 | + ///// <remarks> | |
640 | + ///// </remarks> | |
641 | + ///// <history>2006/XX/XX 新規作成</history> | |
642 | + ////========================================================================= | |
643 | + //public AnimeEpisode this[int storyNumber] | |
644 | + //{ | |
645 | + // get | |
646 | + // { | |
647 | + // if (storyNumber < 1 || mStoryCount < storyNumber) | |
648 | + // throw new Exception("内部エラー: 話数が範囲外です"); | |
649 | + // return (AnimeEpisode)mEpisodes[storyNumber - 1]; | |
650 | + // } | |
651 | + //} | |
652 | + // del yossiepon 20160806 end | |
513 | 653 | |
514 | 654 | public delegate void EnumRecordCallBack(AnimeEpisode record, object param); |
515 | 655 |
@@ -528,7 +668,10 @@ namespace magicAnime | ||
528 | 668 | callBack(episode, param); |
529 | 669 | } |
530 | 670 | |
531 | - return mEpisodes.Count; | |
671 | + // mod yossiepon 20160806 begin | |
672 | + // return mEpisodes.Count; | |
673 | + return mEpisodes.Count + mSpecialEpisodes.Count; | |
674 | + // mod yossiepon 20160806 end | |
532 | 675 | } |
533 | 676 | |
534 | 677 |
@@ -573,6 +716,7 @@ namespace magicAnime | ||
573 | 716 | if( Episodes.Count == 0 ) |
574 | 717 | return NextEpisode.NextUnknown; |
575 | 718 | |
719 | + // del by 7sh 2.0.14.10 2012-03-30 begin | |
576 | 720 | /* しょぼカルは、すべて登録されていな場合がある |
577 | 721 | AnimeEpisode lastEpisode = Episodes[Episodes.Count-1]; |
578 | 722 |
@@ -583,6 +727,7 @@ namespace magicAnime | ||
583 | 727 | return NextEpisode.EndProgram; |
584 | 728 | } |
585 | 729 | */ |
730 | + // del by 7sh 2.0.14.10 2012-03-30 end | |
586 | 731 | |
587 | 732 | // |
588 | 733 | // dateTime以降、リストの中で最も早く放送するEpisodeを見つける |
@@ -608,7 +753,10 @@ namespace magicAnime | ||
608 | 753 | } |
609 | 754 | |
610 | 755 | if (earlyOnAir==null) |
756 | + // mod by 7sh 2.0.14.10 2012-03-30 begin | |
757 | + // return NextEpisode.NextUnknown; | |
611 | 758 | return NextEpisode.EndProgram; |
759 | + // mod by 7sh 2.0.14.10 2012-03-30 end | |
612 | 760 | |
613 | 761 | return NextEpisode.NextDecided; |
614 | 762 | } |
@@ -663,22 +811,30 @@ namespace magicAnime | ||
663 | 811 | // 話数が増えた場合はリスト拡充 |
664 | 812 | //-------------------------------- |
665 | 813 | int maxNumber = 0; |
814 | + // add yossiepon 20160808 begin | |
815 | + int minNumber = 0; | |
816 | + // add yossiepon 20160808 end | |
666 | 817 | |
818 | + // mod yossiepon 20160808 begin | |
819 | + // foreach (SyoboiCalender.SyoboiRecord record in syoboiList) | |
820 | + // maxNumber = System.Math.Max(maxNumber, record.number); | |
667 | 821 | foreach (SyoboiCalender.SyoboiRecord record in syoboiList) |
668 | - maxNumber = System.Math.Max(maxNumber, record.number); | |
822 | + { | |
823 | + if (syoboiTvStation == record.tvStation) | |
824 | + { | |
825 | + maxNumber = System.Math.Max(maxNumber, record.number); | |
826 | + minNumber = System.Math.Min(minNumber, record.number); | |
827 | + } | |
828 | + } | |
829 | + // mod yossiepon 20160808 end | |
669 | 830 | |
670 | 831 | if (StoryCount < maxNumber) |
671 | 832 | StoryCount = maxNumber; // 話数が増えた場合だけ増やす |
672 | 833 | |
673 | - //------------------------------------ | |
674 | - // 話数未設定項目の確認 | |
675 | - //------------------------------------ | |
676 | - foreach (AnimeEpisode episode in Episodes) | |
677 | - { | |
678 | - maxNumber = SyoboiCalender.Unnumbers(episode.Parent.syoboiTvStation, ref syoboiList); | |
679 | - } | |
680 | - if (StoryCount < maxNumber) | |
681 | - StoryCount = maxNumber; // 話数が増えた場合だけ増やす | |
834 | + // add yossiepon 20160808 begin | |
835 | + if (SpecialStoryCount < -minNumber) | |
836 | + SpecialStoryCount = -minNumber; // 特番回が増えた場合だけ増やす | |
837 | + // add yossiepon 20160808 end | |
682 | 838 | |
683 | 839 | //------------------------------- |
684 | 840 | // エピソードごと放送データ更新 |
@@ -947,6 +1103,9 @@ namespace magicAnime | ||
947 | 1103 | |
948 | 1104 | xw.WriteElementString("Title" , title); |
949 | 1105 | xw.WriteElementString("StoryCount" , Convert.ToString(mStoryCount)); |
1106 | + // add yossiepon 20160808 begin | |
1107 | + xw.WriteElementString("SpecialStoryCount" , Convert.ToString(mSpecialStoryCount)); | |
1108 | + // add yossiepon 20160808 end | |
950 | 1109 | xw.WriteElementString("LinkOnlineDatabase" , linkOnlineDatabase ? "1" : "0"); |
951 | 1110 | xw.WriteElementString("SyoboiTID" , Convert.ToString(syoboiTid)); |
952 | 1111 |
@@ -1011,6 +1170,9 @@ namespace magicAnime | ||
1011 | 1170 | mSchedulerProfiles.Clear(); |
1012 | 1171 | |
1013 | 1172 | mEpisodes = new EpisodeList(); |
1173 | + // add yossiepon 20160808 begin | |
1174 | + mSpecialEpisodes = new EpisodeList(); | |
1175 | + // add yossiepon 20160808 end | |
1014 | 1176 | mEncoderProfile = null; |
1015 | 1177 | int length = 0; |
1016 | 1178 |
@@ -1024,6 +1186,10 @@ namespace magicAnime | ||
1024 | 1186 | title = xr.ReadString(); |
1025 | 1187 | else if (xr.LocalName.Equals("StoryCount")) |
1026 | 1188 | mStoryCount = xr.ReadElementContentAsInt(); |
1189 | + // add yossiepon 20160808 begin | |
1190 | + else if (xr.LocalName.Equals("SpecialStoryCount")) | |
1191 | + mSpecialStoryCount = xr.ReadElementContentAsInt(); | |
1192 | + // add yossiepon 20160808 end | |
1027 | 1193 | else if (xr.LocalName.Equals("Length")) |
1028 | 1194 | length = xr.ReadElementContentAsInt(); |
1029 | 1195 | else if (xr.LocalName.Equals("LinkOnlineDatabase")) |
@@ -1066,8 +1232,18 @@ namespace magicAnime | ||
1066 | 1232 | |
1067 | 1233 | episode.Read(xr); |
1068 | 1234 | |
1069 | - mEpisodes.Add(episode); | |
1070 | - } | |
1235 | + // mod yossiepon 20160808 begin | |
1236 | + // mEpisodes.Add(episode); | |
1237 | + if(episode.StoryNumber > 0) | |
1238 | + { | |
1239 | + mEpisodes.Add(episode); | |
1240 | + } | |
1241 | + else | |
1242 | + { | |
1243 | + mSpecialEpisodes.Add(episode); | |
1244 | + } | |
1245 | + // mod yossiepon 20160808 begin | |
1246 | + } | |
1071 | 1247 | else if (xr.LocalName.Equals("EncodeClass")) |
1072 | 1248 | { |
1073 | 1249 | Encoder encoder; |
@@ -76,12 +76,20 @@ namespace magicAnime | ||
76 | 76 | //-------------------------- |
77 | 77 | // 話数が0の場合は前に回す |
78 | 78 | //-------------------------- |
79 | - if( (x.StoryCount == 0) && (y.StoryCount == 0) ) | |
79 | + // mod yossiepon 20160808 begin | |
80 | + //if ((x.StoryCount == 0) && (y.StoryCount == 0)) | |
81 | + // return 0; | |
82 | + //if ((x.StoryCount != 0) && (y.StoryCount == 0)) | |
83 | + // return +1; | |
84 | + //if ((x.StoryCount == 0) && (y.StoryCount != 0)) | |
85 | + // return -1; | |
86 | + if ( ((x.StoryCount + x.SpecialStoryCount) == 0) && ((y.StoryCount + y.SpecialStoryCount) == 0) ) | |
80 | 87 | return 0; |
81 | - if( (x.StoryCount != 0) && (y.StoryCount == 0) ) | |
88 | + if ( ((x.StoryCount + x.SpecialStoryCount) != 0) && ((y.StoryCount + y.SpecialStoryCount) == 0) ) | |
82 | 89 | return +1; |
83 | - if( (x.StoryCount == 0) && (y.StoryCount != 0) ) | |
90 | + if ( ((x.StoryCount + x.SpecialStoryCount) == 0) && ((y.StoryCount + y.SpecialStoryCount) != 0) ) | |
84 | 91 | return -1; |
92 | + // mod yossiepon 20160808 end | |
85 | 93 | |
86 | 94 | //-------------------------- |
87 | 95 | // 放送終了分を末尾に回す |
@@ -125,15 +133,25 @@ namespace magicAnime | ||
125 | 133 | //------------------------------------ |
126 | 134 | |
127 | 135 | aCount = 0; |
128 | - foreach( AnimeEpisode aRecord in x.Episodes ) | |
136 | + // mod yossiepon 20160924 begin | |
137 | + // foreach( AnimeEpisode aRecord in x.Episodes ) | |
138 | + foreach( AnimeEpisode aRecord in x.NormalEpisodes ) | |
139 | + // mod yossiepon 20160924 end | |
129 | 140 | { |
130 | 141 | if( (orderOption & OrderOption.Limit1CoursOption) != 0 ) // 最新1クールに限るオプション(070612) |
131 | 142 | { |
132 | - if( aRecord.StoryNumber < x.StoryCount - 13 ) | |
133 | - continue; | |
134 | - } | |
135 | -// <MOD> 2009/12/28 -> | |
136 | - if( aRecord.HasPlan ) | |
143 | + // mod yossiepon 20160808 begin | |
144 | + //if (aRecord.StoryNumber < x.StoryCount - 13) | |
145 | + // continue; | |
146 | + if (x.StoryCount >= 13) | |
147 | + { | |
148 | + if (aRecord.StoryNumber < x.StoryCount - 13) | |
149 | + continue; | |
150 | + } | |
151 | + // mod yossiepon 20160808 end | |
152 | + } | |
153 | + // <MOD> 2009/12/28 -> | |
154 | + if( aRecord.HasPlan ) | |
137 | 155 | // if( aRecord.CurrentState != AnimeEpisode.State.Undecided ) |
138 | 156 | // <MOD> 2009/12/28 <- |
139 | 157 | { |
@@ -147,13 +165,23 @@ namespace magicAnime | ||
147 | 165 | } |
148 | 166 | |
149 | 167 | bCount = 0; |
150 | - foreach( AnimeEpisode bRecord in y.Episodes ) | |
168 | + // mod yossiepon 20160924 begin | |
169 | + // foreach( AnimeEpisode bRecord in y.Episodes ) | |
170 | + foreach( AnimeEpisode bRecord in y.NormalEpisodes ) | |
171 | + // mod yossiepon 20160924 end | |
151 | 172 | { |
152 | 173 | if( (orderOption & OrderOption.Limit1CoursOption) != 0 ) // 最新1クールに限るオプション(070612) |
153 | 174 | { |
154 | - if( bRecord.StoryNumber < y.StoryCount - 13 ) | |
155 | - continue; | |
156 | - } | |
175 | + // mod yossiepon 20160808 begin | |
176 | + //if (bRecord.StoryNumber < y.StoryCount - 13) | |
177 | + // continue; | |
178 | + if (y.StoryCount >= 13) | |
179 | + { | |
180 | + if (bRecord.StoryNumber < y.StoryCount - 13) | |
181 | + continue; | |
182 | + } | |
183 | + // mod yossiepon 20160808 end | |
184 | + } | |
157 | 185 | // <MOD> 2009/12/28 -> |
158 | 186 | if( bRecord.HasPlan ) |
159 | 187 | // if( bRecord.CurrentState != AnimeEpisode.State.Undecided ) |
@@ -302,7 +302,7 @@ namespace magicAnime | ||
302 | 302 | |
303 | 303 | if ( sched == null ) return ChangeResult.Dontcare; |
304 | 304 | |
305 | - // mod. yossiepon_20150815 begin | |
305 | + // add yossiepon 20150815 begin | |
306 | 306 | |
307 | 307 | // ファイル名によって録画ファイルを特定? |
308 | 308 | if ( Settings.Default.specifiedFile == IdentifyFileMethod.ByFileNameWithID ) |
@@ -313,7 +313,7 @@ namespace magicAnime | ||
313 | 313 | title ); // IDを含んだ録画タイトルにする |
314 | 314 | } |
315 | 315 | |
316 | - // mod. yossiepon_20150815 end | |
316 | + // add yossiepon 20150815 end | |
317 | 317 | |
318 | 318 | Logger.Output("(予約)時間変更操作 " + start.ToString() + "(" + title + ")" ); |
319 | 319 |
@@ -358,7 +358,7 @@ namespace magicAnime | ||
358 | 358 | //----------------------- |
359 | 359 | try |
360 | 360 | { |
361 | - // mod. yossiepon_20150815 begin | |
361 | + // del yossiepon 20150815 begin | |
362 | 362 | |
363 | 363 | //// ファイル名によって録画ファイルを特定? |
364 | 364 | //if ( Settings.Default.specifiedFile == IdentifyFileMethod.ByFileNameWithID ) |
@@ -369,7 +369,7 @@ namespace magicAnime | ||
369 | 369 | // title ); // IDを含んだ録画タイトルにする |
370 | 370 | //} |
371 | 371 | |
372 | - // mod. yossiepon_20150815 end | |
372 | + // del yossiepon 20150815 end | |
373 | 373 | |
374 | 374 | sched.MakeReservation( |
375 | 375 | title , |
@@ -537,19 +537,13 @@ namespace magicAnime | ||
537 | 537 | syoboiTvStationComboBox.Items.Add("(指定なし)"); |
538 | 538 | syoboiTvStationComboBox.SelectedIndex = 0; |
539 | 539 | |
540 | - // 話数を表示 | |
541 | - int maxNumber = 0; | |
542 | - | |
543 | 540 | if( 0 < mZappingTid ) |
544 | 541 | { |
545 | 542 | syoboiTitleTextBox.Text = title; |
546 | 543 | titleTextBox.Text = title; |
547 | 544 | |
548 | 545 | foreach (string tvStation in tvStationList) |
549 | - { | |
550 | 546 | syoboiTvStationComboBox.Items.Add(tvStation); |
551 | - maxNumber = System.Math.Max(maxNumber, SyoboiCalender.Unnumbers(tvStation, ref recordList) ); | |
552 | - } | |
553 | 547 | |
554 | 548 | if (mSelectTvStation != null) |
555 | 549 | { |
@@ -557,12 +551,18 @@ namespace magicAnime | ||
557 | 551 | mSelectTvStation = null; |
558 | 552 | } |
559 | 553 | |
554 | + // 話数を表示 | |
555 | + int maxNumber = 0; | |
556 | + | |
557 | + foreach (SyoboiCalender.SyoboiRecord record in recordList) | |
558 | + maxNumber = System.Math.Max(maxNumber, record.number); | |
559 | + | |
560 | 560 | storyCountComboBox.Text = Convert.ToString(maxNumber); |
561 | 561 | |
562 | 562 | if (mInputTitle != null) |
563 | 563 | { |
564 | 564 | titleTextBox.Text = mInputTitle; |
565 | - mInputTitle= null; | |
565 | + mInputTitle = null; | |
566 | 566 | } |
567 | 567 | } |
568 | 568 | }; |
@@ -356,6 +356,11 @@ | ||
356 | 356 | 0, |
357 | 357 | 0, |
358 | 358 | 0}); |
359 | + this.StoryNumberUpdown.Minimum = new decimal(new int[] { | |
360 | + 2000, | |
361 | + 0, | |
362 | + 0, | |
363 | + -2147483648}); | |
359 | 364 | this.StoryNumberUpdown.Name = "StoryNumberUpdown"; |
360 | 365 | this.StoryNumberUpdown.ReadOnly = true; |
361 | 366 | this.StoryNumberUpdown.Size = new System.Drawing.Size(49, 22); |
@@ -44,8 +44,9 @@ namespace magicAnime | ||
44 | 44 | SubtitleTextBox.Text = r.mSubTitle; |
45 | 45 | FileTextBox.Text = r.FilePath; |
46 | 46 | StoryNumberUpdown.Value = r.StoryNumber; |
47 | - // mod. yossipon_20150815 begin | |
47 | + // add yossipon 20150815 begin | |
48 | 48 | StoryNoTextBox.Text = r.StoryNoStr; |
49 | + // add yossipon 20150815 end | |
49 | 50 | |
50 | 51 | hasPlanCheckBox.Checked = r.HasPlan; |
51 | 52 | if( r.HasPlan ) |
@@ -98,6 +98,9 @@ | ||
98 | 98 | this.encodeGroupSeparator = new System.Windows.Forms.ToolStripSeparator(); |
99 | 99 | this.encodeMenu = new System.Windows.Forms.ToolStripMenuItem(); |
100 | 100 | this.storeMenu = new System.Windows.Forms.ToolStripMenuItem(); |
101 | + this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator(); | |
102 | + this.updateProgramPlanMenu = new System.Windows.Forms.ToolStripMenuItem(); | |
103 | + this.deleteInvalidEpisode = new System.Windows.Forms.ToolStripMenuItem(); | |
101 | 104 | this.toolStripMenuItem6 = new System.Windows.Forms.ToolStripSeparator(); |
102 | 105 | this.renameFileMenu = new System.Windows.Forms.ToolStripMenuItem(); |
103 | 106 | this.unreadMenu = new System.Windows.Forms.ToolStripMenuItem(); |
@@ -745,12 +748,15 @@ | ||
745 | 748 | this.encodeGroupSeparator, |
746 | 749 | this.encodeMenu, |
747 | 750 | this.storeMenu, |
751 | + this.toolStripSeparator9, | |
752 | + this.updateProgramPlanMenu, | |
753 | + this.deleteInvalidEpisode, | |
748 | 754 | this.toolStripMenuItem6, |
749 | 755 | this.renameFileMenu, |
750 | 756 | this.unreadMenu, |
751 | 757 | this.RecordPropertyMenu}); |
752 | 758 | this.contextMenuStrip.Name = "contextMenuStrip"; |
753 | - this.contextMenuStrip.Size = new System.Drawing.Size(225, 220); | |
759 | + this.contextMenuStrip.Size = new System.Drawing.Size(225, 292); | |
754 | 760 | // |
755 | 761 | // playMovieMenu |
756 | 762 | // |
@@ -812,6 +818,25 @@ | ||
812 | 818 | this.storeMenu.Text = "最終保存先へ転送(&M)"; |
813 | 819 | this.storeMenu.Click += new System.EventHandler(this.storeMenu_Click); |
814 | 820 | // |
821 | + // toolStripSeparator9 | |
822 | + // | |
823 | + this.toolStripSeparator9.Name = "toolStripSeparator9"; | |
824 | + this.toolStripSeparator9.Size = new System.Drawing.Size(199, 6); | |
825 | + // | |
826 | + // updateProgramPlanMenu | |
827 | + // | |
828 | + this.updateProgramPlanMenu.Name = "updateProgramPlanMenu"; | |
829 | + this.updateProgramPlanMenu.Size = new System.Drawing.Size(202, 22); | |
830 | + this.updateProgramPlanMenu.Text = "この番組のみデータ更新(&P)"; | |
831 | + this.updateProgramPlanMenu.Click += new System.EventHandler(this.updateProgramPlanMenu_Click); | |
832 | + // | |
833 | + // deleteInvalidEpisode | |
834 | + // | |
835 | + this.deleteInvalidEpisode.Name = "deleteInvalidEpisode"; | |
836 | + this.deleteInvalidEpisode.Size = new System.Drawing.Size(202, 22); | |
837 | + this.deleteInvalidEpisode.Text = "無効な最終回を削除(&D)"; | |
838 | + this.deleteInvalidEpisode.Click += new System.EventHandler(this.deleteInvalidEpisode_Click); | |
839 | + // | |
815 | 840 | // toolStripMenuItem6 |
816 | 841 | // |
817 | 842 | this.toolStripMenuItem6.Name = "toolStripMenuItem6"; |
@@ -1173,7 +1198,7 @@ | ||
1173 | 1198 | this.MainMenuStrip = this.menuStrip; |
1174 | 1199 | this.Name = "MainForm"; |
1175 | 1200 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; |
1176 | - this.Text = "mAgicAnime.NET Ver.7sh mod. yossiepon_20151025"; | |
1201 | + this.Text = "mAgicAnime.NET Ver.7sh mod. yossiepon_20160924"; | |
1177 | 1202 | this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing); |
1178 | 1203 | this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.MainForm_FormClosed); |
1179 | 1204 | this.Load += new System.EventHandler(this.MainForm_Load); |
@@ -1298,6 +1323,9 @@ | ||
1298 | 1323 | private System.Windows.Forms.PictureBox datePictureBox; |
1299 | 1324 | private System.Windows.Forms.ToolStripMenuItem debugForceEmptyMenu; |
1300 | 1325 | private System.Windows.Forms.ToolStripSeparator toolStripMenuItem10; |
1326 | + private System.Windows.Forms.ToolStripSeparator toolStripSeparator9; | |
1327 | + private System.Windows.Forms.ToolStripMenuItem updateProgramPlanMenu; | |
1328 | + private System.Windows.Forms.ToolStripMenuItem deleteInvalidEpisode; | |
1301 | 1329 | } |
1302 | 1330 | } |
1303 | 1331 |
@@ -320,7 +320,10 @@ namespace magicAnime | ||
320 | 320 | |
321 | 321 | foreach( AnimeProgram prog in server.Animes ) |
322 | 322 | { |
323 | - addCols = System.Math.Max( addCols, prog.StoryCount ); | |
323 | + // mod yossiepon 20160808 begin | |
324 | + // addCols = System.Math.Max( addCols, prog.StoryCount ); | |
325 | + addCols = System.Math.Max( addCols, prog.StoryCount + prog.SpecialStoryCount ); | |
326 | + // mod yossiepon 20160808 end | |
324 | 327 | } |
325 | 328 | |
326 | 329 | addCols = Math.Min(addCols, 500); // グリッドの横幅最大値をオーバーしないため |
@@ -734,7 +737,10 @@ namespace magicAnime | ||
734 | 737 | (prog.EncoderType != null)? |
735 | 738 | prog.EncoderProfile.ToString() + "(" + prog.EncoderType.Name + ")" |
736 | 739 | : "(なし)", // エンコード情報 |
737 | - string.Format("{0:D2}",prog.StoryCount), // 全話数 | |
740 | + // mod yossiepon 20160808 begin | |
741 | + // string.Format("{0:D2}",prog.StoryCount), // 全話数 | |
742 | + string.Format("{0:D2}", prog.StoryCount + prog.SpecialStoryCount), // 全話数 | |
743 | + // mod yossiepon 20160808 end | |
738 | 744 | }; |
739 | 745 | |
740 | 746 | for( int i = 0 ;i < newRowData.Length ;++i ) |
@@ -805,6 +811,9 @@ namespace magicAnime | ||
805 | 811 | AnimeEpisode episode = null; |
806 | 812 | int storyNumber = 0; |
807 | 813 | Icon icon = null; |
814 | + // add yossiepon 20160924 begin | |
815 | + Icon icon2 = null; | |
816 | + // add yossiepon 20160924 end | |
808 | 817 | string text; |
809 | 818 | int cellX, cellY; |
810 | 819 | bool border = false; |
@@ -830,7 +839,10 @@ namespace magicAnime | ||
830 | 839 | episode = (AnimeEpisode)dataGrid.Rows[ row ].Cells[ col ].Tag; // セルに対応する話 |
831 | 840 | |
832 | 841 | if ( episode != null ) |
833 | - storyNumber = episode.StoryNumber; | |
842 | + // mod yossiepon 20160808 begin | |
843 | + // storyNumber = episode.StoryNumber; | |
844 | + storyNumber = (episode.StoryNumber > 0) ? episode.StoryNumber : -episode.StoryNumber + prog.StoryCount; | |
845 | + // mod yossiepon 20160808 end | |
834 | 846 | |
835 | 847 | // セル左部分が隠れている場合の対策 |
836 | 848 | int cellHeight = dataGrid.Rows[ row ].Height; |
@@ -1044,6 +1056,19 @@ namespace magicAnime | ||
1044 | 1056 | g.DrawIcon( icon, new Rectangle( newRect.X + 24, newRect.Y + 12, 16, 16 ) ); |
1045 | 1057 | } |
1046 | 1058 | |
1059 | + // add yossiepon 20160924 begin | |
1060 | + // 放送プランデータ異常のセルに警告アイコンを表示する | |
1061 | + if (episode.PlanError) | |
1062 | + icon2 = mViewIcons.warnIcon; | |
1063 | + | |
1064 | + if (icon2 != null) | |
1065 | + { | |
1066 | + if (thumbnailModeButton.Checked) | |
1067 | + g.DrawIcon(icon2, new Rectangle(newRect.X + 18, newRect.Y + 4, 12, 12)); | |
1068 | + else | |
1069 | + g.DrawIcon(icon2, new Rectangle(newRect.X + 6, newRect.Y + 12, 16, 16)); | |
1070 | + } | |
1071 | + // add yossiepon 20160924 end | |
1047 | 1072 | } |
1048 | 1073 | |
1049 | 1074 | //---------------------- |
@@ -1063,8 +1088,11 @@ namespace magicAnime | ||
1063 | 1088 | ty = newRect.Y; |
1064 | 1089 | } |
1065 | 1090 | |
1066 | - // mod. yossiepon_20150705 | |
1067 | - text = episode.StoryNoStr.Length > 0 ? episode.StoryNoStr : episode.StoryNumber.ToString("0"); | |
1091 | + // mod yossiepon 20160808 begin | |
1092 | + // // mod yossiepon 20150705 | |
1093 | + // text = episode.StoryNoStr.Length > 0 ? episode.StoryNoStr : episode.StoryNumber.ToString("0"); | |
1094 | + text = (episode.StoryNoStr.Length > 0) ? episode.StoryNoStr : storyNumber.ToString("0"); | |
1095 | + // mod yossiepon 20160808 end | |
1068 | 1096 | |
1069 | 1097 | g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias; // アンチエイリアス有効 |
1070 | 1098 |
@@ -1219,6 +1247,9 @@ namespace magicAnime | ||
1219 | 1247 | AnimeProgram newAnime = new AnimeProgram( AnimeServer.GetInstance() ); |
1220 | 1248 | |
1221 | 1249 | newAnime.StoryCount = 0; |
1250 | + // add yossiepon 20160808 begin | |
1251 | + newAnime.SpecialStoryCount = 0; | |
1252 | + // add yossiepon 20160808 end | |
1222 | 1253 | |
1223 | 1254 | //------------------------- |
1224 | 1255 | // 番組ダイアログを開く |
@@ -1540,12 +1571,18 @@ namespace magicAnime | ||
1540 | 1571 | episode = episodes[0]; |
1541 | 1572 | prog = episode.Parent; |
1542 | 1573 | |
1543 | - isSelected = (episode != null && 1 <= episode.StoryNumber ); | |
1574 | + // mod yossiepon 20160808 begin | |
1575 | + // isSelected = (episode != null && 1 <= episode.StoryNumber); | |
1576 | + isSelected = (episode != null && 0 != episode.StoryNumber); | |
1577 | + // mod yossiepon 20160808 end | |
1544 | 1578 | } |
1545 | 1579 | |
1546 | - if( isSelected ) | |
1580 | + if ( isSelected ) | |
1547 | 1581 | { |
1548 | - int storyNumber = episode.StoryNumber; | |
1582 | + // mod yossiepon 20160808 begin | |
1583 | + // int storyNumber = episode.StoryNumber; | |
1584 | + int storyNumber = (episode.StoryNumber > 0) ? episode.StoryNumber : -episode.StoryNumber + prog.StoryCount; | |
1585 | + // mod yossiepon 20160808 end | |
1549 | 1586 | |
1550 | 1587 | string[] RecordStateDescription = |
1551 | 1588 | { |
@@ -1565,10 +1602,13 @@ namespace magicAnime | ||
1565 | 1602 | |
1566 | 1603 | titleLabel.Text = prog.title + |
1567 | 1604 | string.Format( |
1568 | - // mod. yossiepon_20150705 begin | |
1605 | + // mod yossiepon 20150705 begin | |
1569 | 1606 | " 第{0}話 {1}" , |
1570 | - episode.StoryNoStr.Length > 0 ? episode.StoryNoStr : episode.StoryNumber.ToString("0"), | |
1571 | - // mod. yossiepon_20150705 end | |
1607 | + // mod yossiepon 20160924 begin | |
1608 | + // episode.StoryNoStr.Length > 0 ? episode.StoryNoStr : episode.StoryNumber.ToString("0"), | |
1609 | + episode.StoryNoStr.Length > 0 ? episode.StoryNoStr : episode.StoryNumber.ToString(Settings.Default.storyNoFormat), | |
1610 | + // mod yossiepon 20160924 end | |
1611 | + // mod yossiepon 20150705 end | |
1572 | 1612 | episode.mSubTitle ); |
1573 | 1613 | |
1574 | 1614 | filePathLabel.Text = episode.FilePath; |
@@ -1657,8 +1697,12 @@ namespace magicAnime | ||
1657 | 1697 | bool enableCancel = true; |
1658 | 1698 | bool enableUnread = true; |
1659 | 1699 | bool enableProp = true; |
1700 | + // add yossiepon 20160924 begin | |
1701 | + bool enableUpdateProg = true; | |
1702 | + bool enableDeleteInv = false; | |
1703 | + // add yossiepon 20160924 end | |
1660 | 1704 | |
1661 | - foreach(AnimeEpisode ep in episodes) | |
1705 | + foreach (AnimeEpisode ep in episodes) | |
1662 | 1706 | { |
1663 | 1707 | enablePlay &= !isMulti && ep.IsPlayable; |
1664 | 1708 | enableEncode &= (ep.HasFile && !ep.IsEncoded && !ep.IsStored); |
@@ -1679,6 +1723,35 @@ namespace magicAnime | ||
1679 | 1723 | enableProp &= !isMulti; |
1680 | 1724 | } |
1681 | 1725 | |
1726 | + // add yossiepon 20160924 begin | |
1727 | + // 無効データ削除判定1:選択セルが1つ | |
1728 | + if (!isMulti) | |
1729 | + { | |
1730 | + AnimeEpisode ep = episodes[0]; | |
1731 | + AnimeEpisode lastEp; | |
1732 | + | |
1733 | + AnimeProgram prog = ep.Parent; | |
1734 | + | |
1735 | + if (ep.StoryNumber > 0) | |
1736 | + { | |
1737 | + // 通常回の最後を取得 | |
1738 | + lastEp = prog.NormalEpisodes[prog.NormalEpisodes.Count - 1]; | |
1739 | + } | |
1740 | + else | |
1741 | + { | |
1742 | + // 特番回の最後を取得 | |
1743 | + lastEp = prog.SpecialEpisodes[prog.SpecialEpisodes.Count - 1]; | |
1744 | + } | |
1745 | + | |
1746 | + // 無効データ削除判定2:選択中のセルが放送プランデータ異常またはプランなし、かつ未予約、かつファイルなし、かつ最終回か? | |
1747 | + if ( (ep.PlanError || !ep.HasPlan) && !ep.IsReserved && !ep.HasFile && (ep == lastEp) ) | |
1748 | + { | |
1749 | + // メニュー有効 | |
1750 | + enableDeleteInv = true; | |
1751 | + } | |
1752 | + } | |
1753 | + // add yossiepon 20160924 end | |
1754 | + | |
1682 | 1755 | //-------------------------------- |
1683 | 1756 | // 拡張ツール項目 |
1684 | 1757 | //-------------------------------- |
@@ -1730,6 +1803,10 @@ namespace magicAnime | ||
1730 | 1803 | cancelReserveMenu.Enabled = enableCancel; |
1731 | 1804 | unreadMenu.Enabled = enableUnread; |
1732 | 1805 | RecordPropertyMenu.Enabled = enableProp; |
1806 | + // add yossiepon 20160924 begin | |
1807 | + updateProgramPlanMenu.Enabled = enableUpdateProg; | |
1808 | + deleteInvalidEpisode.Enabled = enableDeleteInv; | |
1809 | + // add yossiepon 20160924 end | |
1733 | 1810 | |
1734 | 1811 | unreadMenu.Checked = !isMulti && episodes[0].Unread; |
1735 | 1812 | unreadMenu.Visible = !Settings.Default.disableUnread; |
@@ -2924,7 +3001,10 @@ namespace magicAnime | ||
2924 | 3001 | { |
2925 | 3002 | storyNumber = ep.StoryNumber; |
2926 | 3003 | |
2927 | - if(1 <= storyNumber) | |
3004 | + // mod yossiepon 20160808 begin | |
3005 | + //if (1 <= storyNumber) | |
3006 | + if (0 != storyNumber) | |
3007 | + // mod yossiepon 20160808 end | |
2928 | 3008 | { |
2929 | 3009 | episodes.Add(ep); |
2930 | 3010 | } |
@@ -2991,7 +3071,67 @@ namespace magicAnime | ||
2991 | 3071 | if (this.Height < 310) { this.Height = 310; } |
2992 | 3072 | } |
2993 | 3073 | |
3074 | + // add yossiepon 20160924 begin | |
3075 | + //========================================================================= | |
3076 | + /// <summary> | |
3077 | + /// 番組データ更新メニュー項目のクリック処理 | |
3078 | + /// </summary> | |
3079 | + /// <remarks> | |
3080 | + /// </remarks> | |
3081 | + /// <history>2006/XX/XX 新規作成</history> | |
3082 | + //======================================================================== | |
3083 | + private void updateProgramPlanMenu_Click(object sender, EventArgs e) | |
3084 | + { | |
3085 | + var episodes = GridSelectEpisodes; | |
3086 | + | |
3087 | + if (1 != episodes.Count) | |
3088 | + return; | |
3089 | + | |
3090 | + AnimeEpisode ep = episodes[0]; | |
3091 | + AnimeProgram prog = ep.Parent; | |
3092 | + List<AnimeProgram> animes = new List<AnimeProgram>(); | |
3093 | + animes.Add(prog); | |
2994 | 3094 | |
3095 | + AnimeServer.GetInstance().BeginUpdate(updateOption.Force, animes); | |
3096 | + RefreshContent(); | |
3097 | + } | |
3098 | + | |
3099 | + //========================================================================= | |
3100 | + /// <summary> | |
3101 | + /// 無効最終回削除メニュー項目のクリック処理 | |
3102 | + /// </summary> | |
3103 | + /// <remarks> | |
3104 | + /// </remarks> | |
3105 | + /// <history>2006/XX/XX 新規作成</history> | |
3106 | + //======================================================================== | |
3107 | + private void deleteInvalidEpisode_Click(object sender, EventArgs e) | |
3108 | + { | |
3109 | + var episodes = GridSelectEpisodes; | |
3110 | + | |
3111 | + if (1 != episodes.Count) | |
3112 | + return; | |
3113 | + | |
3114 | + AnimeEpisode ep = episodes[0]; | |
3115 | + AnimeProgram prog = ep.Parent; | |
3116 | + | |
3117 | + if (ep.StoryNumber > 0) | |
3118 | + { | |
3119 | + // 通常回の最後を削除 | |
3120 | + if (prog.StoryCount > 0) | |
3121 | + { | |
3122 | + prog.StoryCount = prog.StoryCount - 1; | |
3123 | + } | |
3124 | + } | |
3125 | + else | |
3126 | + { | |
3127 | + // 特番回の最後を削除 | |
3128 | + if (prog.SpecialStoryCount > 0) | |
3129 | + { | |
3130 | + prog.SpecialStoryCount = prog.SpecialStoryCount - 1; | |
3131 | + } | |
3132 | + } | |
3133 | + } | |
3134 | + // add yossiepon 20160924 end | |
2995 | 3135 | } |
2996 | 3136 | |
2997 | 3137 | } |
@@ -562,10 +562,11 @@ namespace magicAnime | ||
562 | 562 | "東奔西走アニメライフ", |
563 | 563 | "20070401", |
564 | 564 | "2500", |
565 | - // mod. yossiepon_20150705 begin | |
565 | + // mod yossiepon 20150705 begin | |
566 | + // "東都テレビ" | |
566 | 567 | "東都テレビ", |
567 | 568 | "SP1"); |
568 | - // mod. yossiepon_20150705 end | |
569 | + // mod yossiepon 20150705 end | |
569 | 570 | |
570 | 571 | sampleNameFormatTextBox.Text = sampleText; |
571 | 572 | } |
@@ -64,7 +64,7 @@ namespace magicAnime.UserInterface | ||
64 | 64 | mNotifyIcon.DoubleClick += notifyIcon_DoubleClick; |
65 | 65 | mNotifyIcon.BalloonTipIcon = ToolTipIcon.Info; |
66 | 66 | mNotifyIcon.BalloonTipTitle = "mAgicAnime"; |
67 | - mNotifyIcon.Text = "mAgicAnime Ver.7sh mod. yossiepon_20151025"; | |
67 | + mNotifyIcon.Text = "mAgicAnime Ver.7sh mod. yossiepon_20160924"; | |
68 | 68 | // trayIcon.Icon = ((System.Drawing.Icon)(resources.GetObject( "notifyIcon.Icon" ))); |
69 | 69 | |
70 | 70 | //--------------------------- |