diff --git a/source/ChanSort.Api/Model/ChannelInfo.cs b/source/ChanSort.Api/Model/ChannelInfo.cs index 4cbeeac..66a048a 100644 --- a/source/ChanSort.Api/Model/ChannelInfo.cs +++ b/source/ChanSort.Api/Model/ChannelInfo.cs @@ -247,42 +247,47 @@ namespace ChanSort.Api #endregion #region AddDebug() - public void AddDebug(byte val) + public ChannelInfo AddDebug(byte val) { if (this.Debug == null) this.Debug = val.ToString("x2"); else this.Debug += " " + val.ToString("x2"); + return this; } - public void AddDebug(ushort val) + public ChannelInfo AddDebug(ushort val) { if (this.Debug == null) this.Debug = val.ToString("x4"); else this.Debug += " " + val.ToString("x4"); + return this; } - public void AddDebug(uint val) + public ChannelInfo AddDebug(uint val) { if (this.Debug == null) this.Debug = val.ToString("x8"); else this.Debug += " " + val.ToString("x8"); + return this; } - public void AddDebug(byte[] data, int offset, int len) + public ChannelInfo AddDebug(byte[] data, int offset, int len) { for (int i = 0; i < len; i++) this.AddDebug(data[offset + i]); + return this; } - public void AddDebug(string val) + public ChannelInfo AddDebug(string val) { if (this.Debug == null) this.Debug = val; else this.Debug += " " + val; + return this; } #endregion diff --git a/source/ChanSort.Api/Resources.ru.resx b/source/ChanSort.Api/Resources.ru.resx index d58980a..56bb158 100644 --- a/source/ChanSort.Api/Resources.ru.resx +++ b/source/ChanSort.Api/Resources.ru.resx @@ -1,4 +1,4 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Этот файл-список каналов не содержит никаких данных. +Скорее всего, во время начальной настройки телевизора был выбран предопределённый список каналов. Такие списки не экспортируются и не могут быть отредактированы на телевизоре или в компьютере. +Чтобы получить список, который можно редактировать на компьютере, нужно сбросить настройки телевизора до заводских и выбрать опцию 'Другое' при настройке спутниковых каналов. + + + Каналы не найдены + + \ No newline at end of file diff --git a/source/ChanSort.Loader.LG.UI/PresetProgramNrDialog.ru.resx b/source/ChanSort.Loader.LG.UI/PresetProgramNrDialog.ru.resx index d58980a..6676eb7 100644 --- a/source/ChanSort.Loader.LG.UI/PresetProgramNrDialog.ru.resx +++ b/source/ChanSort.Loader.LG.UI/PresetProgramNrDialog.ru.resx @@ -1,4 +1,4 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Телевизор может неправильно сообщать об ошибке импорта, но это можно игнорировать. + + + ИНФОРМАЦИЯ: После импорта списка обратно в телевизор отключите его и снова включите через несколько секунд. + + + ВНИМАНИЕ: В загруженном списке обнаружены ошибки контрольных сумм! + +Возможны две ситуации, как это может произойти: + +- Повреждён внутренний список каналов телевизора (например, после обновления прошивки) + Это можно исправить, снова выполнив сканирование каналов или сбросив настройки телевизора. + Затем снова экспортируйте список и откройте его в ChanSort. + Попытка отредактировать и импортировать повреждённый файл может привести к некорректной работе телевизора. + +- Плохой USB-накопитель (плохие ячейки памяти или несовместимый формат файла) + Попробуйте использовать флешку объёмом не больше 16 ГБ, отформатированную в FAT32 (но не в NTFS или exFAT). + + + Игнорировать ошибку и всё равно редактировать список + + + Отмена + + \ No newline at end of file diff --git a/source/ChanSort.Loader.Sony/ChanSort.Loader.Sony.csproj b/source/ChanSort.Loader.Sony/ChanSort.Loader.Sony.csproj index 8e78715..b3d1791 100644 --- a/source/ChanSort.Loader.Sony/ChanSort.Loader.Sony.csproj +++ b/source/ChanSort.Loader.Sony/ChanSort.Loader.Sony.csproj @@ -79,5 +79,10 @@ ChanSort.Api + + + PreserveNewest + + \ No newline at end of file diff --git a/source/ChanSort.Loader.Sony/ChanSort.Loader.Sony.ini b/source/ChanSort.Loader.Sony/ChanSort.Loader.Sony.ini new file mode 100644 index 0000000..9d528e2 --- /dev/null +++ b/source/ChanSort.Loader.Sony/ChanSort.Loader.Sony.ini @@ -0,0 +1,5 @@ +[sdb.xml] +# SDBEdit 0.9 doesn't set any of these flags, the official Sony Editor 1.2.0 does +setProgNrEditedFlag=true +setProgNameEditedFlag=true +setDeletedFlagInNwOptionMask=true diff --git a/source/ChanSort.Loader.Sony/Serializer.cs b/source/ChanSort.Loader.Sony/Serializer.cs index 371247b..1a5f0d3 100644 --- a/source/ChanSort.Loader.Sony/Serializer.cs +++ b/source/ChanSort.Loader.Sony/Serializer.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; +using System.Reflection; using System.Text; using System.Xml; using System.Xml.Schema; using ChanSort.Api; +// ReSharper disable UnusedMember.Local namespace ChanSort.Loader.Sony { @@ -40,6 +42,8 @@ namespace ChanSort.Loader.Sony private readonly Dictionary channeListNodes = new Dictionary(); private ChannelList mixedFavList; + private readonly IniFile ini; + private readonly IniFile.Section iniSection; #region enum NwMask // ui4_nw_mask for the Android "e110"-format @@ -57,16 +61,18 @@ namespace ChanSort.Loader.Sony NotDeletedByUserOption = 0x0200, Radio = 0x0400, Encrypted = 0x0800, + Tv = 0x2000, MaskWhenDeleted = 0x0206 } + // ui4_nw_option_mask for the Android "e110"-format [Flags] private enum NwOptionMask : uint { - NameEdited = 1 << 3, // guess based on values from Hisense - ChNumEdited = 1 << 10, // used by Sony Channel Editor 1.2.0, SetEdit 1.21 and Hisense - DeletedByUser = 1 << 13 // used by Sony Channel Editor 1.2.0 and Hisense + NameEdited = 1 << 3, // 8, 0x0008 - guess based on values from Hisense + ChNumEdited = 1 << 10, // 1024, 0x0400 - used by Sony Channel Editor 1.2.0, SetEdit 1.21 and Hisense + DeletedByUser = 1 << 13 // 8192, 0x2000 - used by Sony Channel Editor 1.2.0 and Hisense } #endregion @@ -102,6 +108,10 @@ namespace ChanSort.Loader.Sony list.VisibleColumnFieldNames.Remove("ShortName"); list.VisibleColumnFieldNames.Remove("Provider"); } + + string iniFile = Assembly.GetExecutingAssembly().Location.Replace(".dll", ".ini"); + this.ini = new IniFile(iniFile); + this.iniSection = ini.GetSection("sdb.xml"); } #endregion @@ -124,10 +134,8 @@ namespace ChanSort.Loader.Sony ValidationFlags = XmlSchemaValidationFlags.None, DtdProcessing = DtdProcessing.Ignore }; - using (var reader = XmlReader.Create(new StringReader(textContent), settings)) - { - doc.Load(reader); - } + using var reader = XmlReader.Create(new StringReader(textContent), settings); + doc.Load(reader); } catch { @@ -336,15 +344,15 @@ namespace ChanSort.Loader.Sony { var recId = int.Parse(svcData["ui2_svl_rec_id"][i]); var chan = new Channel(signalSource, i, recId); - var no = ParseInt(svcData["No"][i]); + var no = ParseInt(svcData["No"][i]); // the lower 18 bits always have 0x80 set and bits 0-1 seem to encode a service type like 1=TV, 2=radio, 3=data + chan.AddDebug("No.low=").AddDebug((uint)no & 0x3FFFF); chan.OldProgramNr = (int)((uint)no >> 18); + chan.RecordOrder = chan.OldProgramNr; var nwMask = (NwMask)uint.Parse(svcData["ui4_nw_mask"][i]); - chan.AddDebug("NW="); - chan.AddDebug((uint)nwMask); - chan.AddDebug("OPT="); - chan.AddDebug(uint.Parse(svcData["ui4_nw_option_mask"][i])); + chan.AddDebug("NW=").AddDebug((uint)nwMask); + chan.AddDebug("OPT=").AddDebug(uint.Parse(svcData["ui4_nw_option_mask"][i])); chan.IsDeleted = (nwMask & NwMask.NotDeletedByUserOption) == 0; - chan.IsDeleted |= svcData["b_deleted_by_user"][i] != "1"; + chan.IsDeleted |= svcData["b_deleted_by_user"][i] != "1"; // reverse logic: 0=deleted, 1=NOT deleted chan.Hidden = (nwMask & NwMask.Visible) == 0; chan.Encrypted = (nwMask & NwMask.Encrypted) != 0; chan.Encrypted |= dvbData["t_free_ca_mode"][i] == "1"; @@ -749,12 +757,26 @@ namespace ChanSort.Loader.Sony if (field == "ui4_nw_mask") { var mask = ((uint) ch.Favorites << 4) | (ch.Hidden ? 0u : (uint) NwMask.Visible) | (uint.Parse(value) & ~(uint) (NwMask.FavMask | NwMask.Visible)); + // for deleted channels in the e110 format SDBEdit 0.9 removes only 0x200 from this mask, Sony Channel Editor 1.2.0 clears 0x206 if (ch.IsDeleted) mask &= ~(uint)NwMask.MaskWhenDeleted; return mask.ToString(); } + if (field == "ui4_nw_option_mask") - return (uint.Parse(value) | (uint)(NwOptionMask.ChNumEdited | (ch.IsNameModified ? NwOptionMask.NameEdited : 0) | (ch.IsDeleted ? NwOptionMask.DeletedByUser : 0))).ToString(); + { + // SDBEdit 0.9 does not change this field at all (in the e110 format) + // Sony Channel Editor 1.2.0 sets the DeletedByUser flag + ChNumEdited flag + var mask = (NwOptionMask)uint.Parse(value); + if (this.iniSection.GetBool("setProgNrEditedFlag", true)) + mask = (mask & ~NwOptionMask.ChNumEdited) | (ch.IsNameModified ? NwOptionMask.ChNumEdited : 0); + if (this.iniSection.GetBool("setProgNameEditedFlag", true)) + mask = (mask & ~NwOptionMask.NameEdited) | (ch.IsNameModified ? NwOptionMask.NameEdited : 0); + if (this.iniSection.GetBool("setDeletedFlagInNwOptionMask", true)) + mask = mask & ~NwOptionMask.DeletedByUser | (ch.IsDeleted ? NwOptionMask.DeletedByUser : 0); + return ((uint)mask).ToString(); + } + if (field == "aui1_custom_data") // mixed favorite list position { var vals = value.Split(' '); diff --git a/source/ChanSort/AboutForm.ru.resx b/source/ChanSort/AboutForm.ru.resx index 93408e6..31abb2a 100644 --- a/source/ChanSort/AboutForm.ru.resx +++ b/source/ChanSort/AboutForm.ru.resx @@ -118,7 +118,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - О ChanSort + О программе ChanSort Закрыть @@ -133,6 +133,6 @@ Лицензия: - Благодарность: + Благодарности: \ No newline at end of file diff --git a/source/ChanSort/ActionBox.ru.resx b/source/ChanSort/ActionBox.ru.resx index d58980a..e33c83c 100644 --- a/source/ChanSort/ActionBox.ru.resx +++ b/source/ChanSort/ActionBox.ru.resx @@ -1,4 +1,4 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Базовый файл-список: + + + ← нажмите кнопку, чтобы выбрать файл + + + Выберите файл с порядком каналов, который вы хотите применить к текущему списку. Можно использовать один из предопределённых списков ChanSort (TXT, CHL, CSV) или файл данных с другого телевизора (SCM, TLL, DB, BIN, ...) + + + Автопереупорядочивание всех списков в ТВ-файле + + + Расширенное переупорядочивание + + + Базовый список: + + + Целевой список: + + + ТВ + + + Радио + + + Начинать с №: + + + (т.е. пусть радиоканалы начинаются с 5000, чтобы избежать конфликтов с номерами телеканалов) + + + Данные/Другое + + + Последовательная нумерация (удалять пропуски из списка №пр) + + + IP (сеть) + + + Спутник + + + Вход: + + + Антенна + + + Кабель + + + Сигнал: + + + Аналоговый + + + Цифровой + + + Тип канала: + + + Применить + + + OK + + + Закрыть/Отмена + + + Открыть вики-страницу ChanSort с информацией и загрузкой базовых списков + + + 1. Выберите базовый файл-список + + + Если ТВ-файл и базовый файл содержат несколько списков или используют различную группировку, к целевому списку можно применить выбранные части базового списка. При необходимости этот шаг можно повторить. + + + Эта опция доступна, только если ТВ-файл и базовый список организованы одинаково (т.е. те же субсписки для комбинаций антенны / кабеля / спутника, ТВ / радио, аналога / цифры) + + + 2. Наведите порядок в ТВ-файле + + + Применить базовый список + + \ No newline at end of file diff --git a/source/ChanSort/ReferenceListForm.tr.resx b/source/ChanSort/ReferenceListForm.tr.resx index 7151348..40b932d 100644 --- a/source/ChanSort/ReferenceListForm.tr.resx +++ b/source/ChanSort/ReferenceListForm.tr.resx @@ -152,30 +152,6 @@ veya başka bir TV'den veri dosyası (SCM, TLL, DB, BIN, ...) (TV kanalı numaralarıyla çakışmaları önlemek için radyo kanallarının 5000'den başlamasına izin verin) - - 1 - - - 1 - - - 100 - - - 500 - - - 1000 - - - 2000 - - - 5000 - - - 7000 - Veri / Diğer diff --git a/source/ChanSort/SkinPickerForm.ru.resx b/source/ChanSort/SkinPickerForm.ru.resx index c7f95a0..37066a4 100644 --- a/source/ChanSort/SkinPickerForm.ru.resx +++ b/source/ChanSort/SkinPickerForm.ru.resx @@ -118,12 +118,15 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - Отменить + Отмена - Ok + OK - Цветовая схема + Цветовая тема + + + Использовать стандартную тему \ No newline at end of file diff --git a/source/ChanSort/WaitForm1.ru.resx b/source/ChanSort/WaitForm1.ru.resx index 1861c36..0270f0e 100644 --- a/source/ChanSort/WaitForm1.ru.resx +++ b/source/ChanSort/WaitForm1.ru.resx @@ -118,6 +118,9 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - Создание файла данных ТВ... + Создание файла ТВ-данных… + + + Подождите \ No newline at end of file diff --git a/source/Translation.xlsx b/source/Translation.xlsx index 4a09374..2eedbeb 100644 Binary files a/source/Translation.xlsx and b/source/Translation.xlsx differ diff --git a/source/Translation_ru.xlsx b/source/Translation_ru.xlsx new file mode 100644 index 0000000..00f7491 Binary files /dev/null and b/source/Translation_ru.xlsx differ