Beiträge von MegaV0lt
-
-
Vergleiche mal die Datei mit Deiner:
https://github.com/horchi/vdr-…ob/master/configs/epg.dat -
Neue Version 1.0.3 mit kleineren Änderungen
Code2024-03-25: Version 1.0.3 - [fix] Skip justify for fixed font - [add] Script 'check_fonts_for_hairspace.sh' to list fonts with 'HairSpace'. The script can be found in 'contrib/' - [add] Some new fonts added in 'contrib/Fonts' - [update] If available use 'HairSpace' for justifying text for best result - [update] Only justify lines with minimum of 80% width - [update] Some internal optimizations
-
die Bilder im *.rec Folder sind nur für Anwendungen, die das plugin service interface von tvscraper nicht nutzen, also z.B. für KODI.
live und die VDR skins nutzen das plugin service interface von tvscraper und ignorieren diese Bilder.
Das mag ja stimmen. Bei mir sind aber einige Aufnahmen mit Bildern im Verzeichnis, wo das Skin nichts anzeigt, außer ich lade die .jpg im Aufnahme Verzeichnis
-
Ich glaube was Taipan meint, wäre eine Automatisierung, dass nach einem erfolgreichen Schnitt bereits gescrapte Dateien (Bilder + die JSON) vom ungeschnittenen Ordner in den geschnittenen Ordner kopiert werden.
Mach ich mit dem recordinghook vom VDR:
VDR_config/local/vdr.d/scripts/vdr_record.sh at f0ce837eac5450fa0bd2a54af67a05f5375223bc · MegaV0lt/VDR_config_config. Contribute to MegaV0lt/VDR_config development by creating an account on GitHub.github.com -
Ich hatte letztens auch erst eine menge '\n' gesehen.
-
Wir starten per crontab stündlich 2 mp_logos scripts die Logos in dark und light ablegen
Ein mal pro Stunde kommt mir etwas oft vor. Vor allem, wenn man sich das Git anschaut, das schon ein Jahr nicht mehr aktualisiert worden ist.
Ein Update ein mal pro Woche reicht normalerweise aus.
Für die VDR-Kanallogos empfehle ich die Skripte Picon.cz2VDR oder Picons2VDR
-
Ich würde Nummer 3 auf jeden Fall streichen.
-
Hab jetzt FT_ULong für charcode eingebaut. Er findet keine Zeichen wie 0x200A. Aber z. B. 0x2070 schon
-
Mit folgender Änderung (! statt HairSpace bei der Abfrage):
Codeu_int32_t HairSpaceCode = 0x00000021; // 0x0000200A; // HairSpace: U+200A u_int32_t ThinSpaceCode = 0x00002009; // ThinSpace: U+2009 if (GetCharIndex(Setup.FontOsd, HairSpaceCode) > 0) { m_FillChar = u8"\U0000200A"; dsyslog("flatPlus: JustifyLine(): Using 'HairSpace' (U+200A) as 'FillChar'");
Bekomm ich das:
Im Log sehe ich, dass das HairSpace verwendet wird. Hat 1 Pixel Breite. Jetz fragt sich warum der U+200A nicht geht. Vorhanden ist er ja, wie im Bild zu sehen...
Teste noch ein Wenig...
-
Danke für den Hinweis; Aber immer noch 0
Code
Alles anzeigenu_int32_t GetCharIndex(const char *Name, u_int32_t CharCode) { FT_Library library; FT_Face face; FT_UInt glyph_index {0}; cString FontFileName = cFont::GetFontFileName(Name); int rc = FT_Init_FreeType(&library); if (!rc) { rc = FT_New_Face(library, *FontFileName, 0, &face); if (!rc) { FT_Select_Charmap(face, FT_ENCODING_UNICODE); // Ensure an unicode charater map is loaded rc = FT_Set_Char_Size(face, 8 * 64, 8 * 64, 0, 0); // TODO: Is that needed? if (!rc) { glyph_index = FT_Get_Char_Index(face, CharCode); // Glyph index 0 means 'undefined character code' dsyslog("flatPlus: GetCharIndex() CharCode: 0x%X (%d), glyph_index: %d", CharCode, CharCode, glyph_index); } else esyslog("flatPlus: FreeType: error %d during FT_Set_Char_Size (font = %s)\n", rc, *FontFileName); } else esyslog("flatPlus: FreeType: load error %d (font = %s)", rc, *FontFileName); } else esyslog("flatPlus: FreeType: initialization error %d (font = %s)", rc, *FontFileName); FT_Done_Face(face); FT_Done_FreeType(library); return glyph_index; }
Log:
CodeMär 01 07:25:59 yavdr-vbox vdr[12903]: [12903] loading /srv/vdr/video/%%Die_interdimensionale_Höhle_der_Pancakes__(S03E11)_[75,3%]/2022-11-03.05.08.62-0.rec/marks Mär 01 07:25:59 yavdr-vbox vdr[12903]: [12903] flatPlus: GetCharIndex() CharCode: 0x200A (8202), glyph_index: 0 Mär 01 07:25:59 yavdr-vbox vdr[12903]: [12903] flatPlus: GetCharIndex() CharCode: 0x2009 (8201), glyph_index: 0 Mär 01 07:25:59 yavdr-vbox vdr[12903]: [12903] flatPlus: JustifyLine(): Using 'Space' (U+0020) as 'FillChar' Mär 01 07:25:59 yavdr-vbox vdr[12903]: [12903] flatPlus: JustifyLine() [Line: 13 Space, 727 width, 81 length] [FillChar: 5 needed, 0 blocksize, 5 remainder, 5 width] [FillChars: 0 length] Mär 01 07:25:59 yavdr-vbox vdr[12903]: [12903] flatPlus: JustifyLine() InsertedFillChar after third loop (' '): 5
-
Beim Versuch zu testen, ob das Zeichen im Font enthalten ist, bekomm ich immer 0 zurück. 0 ist in diesem Fall 'Zeichen nicht vorhanden'
Die Funktion dazu:
Code
Alles anzeigenu_long GetCharIndex(const char *Name, u_long CharCode) { FT_Library library; FT_Face face; cString FontFileName = cFont::GetFontFileName(Name); u_long glyph_index {0}; // FT_ULong; int rc = FT_Init_FreeType(&library); if (!rc) { rc = FT_New_Face(library, *FontFileName, 0, &face); if (!rc) { FT_Select_Charmap(face, FT_ENCODING_UNICODE); // Ensure an unicode charater map is loaded rc = FT_Set_Char_Size(face, 64, 64, 0, 0); // TODO: Is that needed? if (!rc) { glyph_index = FT_Get_Char_Index(face, CharCode); // The index. 0 means ‘undefined character code’ dsyslog("flatPlus: GetCharIndex() glyph_index: %ld", glyph_index); } else esyslog("flatPlus: FreeType: error %d during FT_Set_Char_Size (font = %s)\n", rc, *FontFileName); } else esyslog("flatPlus: FreeType: load error %d (font = %s)", rc, *FontFileName); } else esyslog("flatPlus: FreeType: initialization error %d (font = %s)", rc, *FontFileName); FT_Done_Face(face); FT_Done_FreeType(library); return glyph_index; }
Teste mit der Ubuntu Schriftart, die die Zeichen enthält laut Zeichentabelle
-
Neue Version 1.0.2 ist fertig:
Code
Alles anzeigen2024-02-27: Version 1.0.2 - [fix] New try to fix wrong line breaks in '...' - [add] Search for manual poster also in replay - [add] Option to show the wrapped text in event and recording view justified Default disabled. To activate go to menu - menu settings - [add] Make the precipitation % locale-agnostic and add a new script for new subscribers of the Open Weather (API 3.0) Thanks to JTe-git - [update] Merge InsertSeriesInfos() and InsertMovieInfos() - [update] Update eventsview-MV.sql to extract Season and Episode from shorttext - [update] Some internal optimizations
Das 'Feature' Blocksatz ist im Teststadium und kann im Plugin Menü unter Menü - Menü Einstellungen aktiviert werden und sieht dann in etwa so aus:
Außerdem gibt es von JTe-git noch Anpassungen für OpenWeatherMap API 3.0
-
Oh Mann, darauf bin ich nicht gekommen... Verwende DroidSans
Hab es jetzt erst mal mit stink normalen Leerzeichen gelöst...
-
Ich bastel gerade an einer einfachen Version einer Blocksatz-Funktion.
Sie soll in Zeilen 'Hairspace' einfügen, um einen Blocksatz zu realisieren.
Leider werden die Zeichen U+2009 (Thin Space) Oder U+200A (Hair Space) nur als Kästchen mit 10 Pixel Breite angezeigt.
Anbei die Funktion, in der noch eine Menge dsyslog's sind
Code
Alles anzeigenvoid JustifyLine(std::string &Line, cFont *Font, int LineMaxWidth) { // NOLINT if (isempty(Line.c_str())) { // Check for empty line dsyslog("flatPlus: JustifyLine() ---Empty line---"); return; } // Count spaces in 'Line' int LineSpaces {0}; for (auto &ch : Line) if (ch == ' ') ++LineSpaces; // Hair Space is a very small space: https://de.wikipedia.org/wiki/Leerzeichen#Schriftzeichen_in_ASCII_und_andere_Kodierungen // Schmales Leerzeichen U+2009 (thinsp) const char *FillChar = u8"\U00002009"; // U+200A (Decimal 8202) int FillCharWidth = Font->Width(FillChar); // Check if at least one fill char fits in to the line int LineWidth = Font->Width(Line.c_str()); // Width in Pixel if ((LineWidth + FillCharWidth) > LineMaxWidth) { dsyslog("flatPlus: JustifyLine() ---Line too long for extra space---"); return; } if (LineSpaces == 0 || FillCharWidth == 0) { // Avoid div/0 with lines without space dsyslog("flatPlus: JustifyLine() Zero value found: Spaces: %d, FillCharWidth: %d", LineSpaces, FillCharWidth); return; } // How many fill char we need? int NeedFillChar = (LineMaxWidth - LineWidth) / FillCharWidth; int FillCharBlock = NeedFillChar / LineSpaces; // For inserting multiple 'FillChar' int FillCharRemainder = NeedFillChar % LineSpaces; std::string FillChars(""); for (int i {0}; i < FillCharBlock; ++i) { // Create 'FillChars' block for inserting FillChars.append(FillChar); } size_t FillCharsLength = FillChars.size(); if (LineWidth > (LineMaxWidth * 0.6)) { // Lines shorter than 60% looking bad when justified dsyslog("flatPlus: JustifyLine() [Line: %d Space, %d width]" " [FillChar: %d needed, %d blocksize, %d remainder, %d width]" " [FillChars: %ld length]", LineSpaces, LineWidth, NeedFillChar, FillCharBlock, FillCharRemainder, FillCharWidth, FillCharsLength); int InsertedFillChar {0}; size_t pos = Line.find_first_of(' '); if ((FillCharBlock > 0) && InsertedFillChar <= (NeedFillChar - FillCharBlock)) { // Is space for one block? pos = Line.find_first_of(' '); while (pos != std::string::npos && ((InsertedFillChar + FillCharBlock) < NeedFillChar)) { if (!(isspace(Line[pos - 1]))) { dsyslog("flatPlus: Insert block at %ld", pos); Line.insert(pos, FillChars); InsertedFillChar += FillCharBlock; } pos = Line.find_first_of(' ', pos + FillCharsLength + 1); // Add inserted chars plus 1 } dsyslog("flatPlus: JustifyLine() InsertedFillChar after second loop (' '): %d", InsertedFillChar); } // Insert the remainder of 'NeedFillChar' if (InsertedFillChar <= (NeedFillChar - 1)) { pos = Line.find_first_of(' '); while (pos != std::string::npos && (InsertedFillChar < NeedFillChar)) { if (!(isspace(Line[pos - 1]))) { dsyslog("flatPlus: Insert char at %ld", pos); Line.insert(pos, FillChar); ++InsertedFillChar; } pos = Line.find_first_of(' ', pos + 4); // 'FillChar' length is 3 } dsyslog("flatPlus: JustifyLine() InsertedFillChar after third loop (' '): %d", InsertedFillChar); } } else { dsyslog("flatPlus: JustifyLine() Line too short for justifying: %.0f/%d", LineMaxWidth * 0.6, LineMaxWidth); // return; } }
Ein Auszug vom Log für die ersten zwei langen Zeilen:
Code
Alles anzeigenFeb 27 11:08:42 yavdr-vbox vdr[26565]: [26565] flatPlus: JustifyLine() [Line: 13 Space, 727 width] [FillChar: 2 needed, 0 blocksize, 2 remainder, 10 width] [FillChars: 0 length] Feb 27 11:08:42 yavdr-vbox vdr[26565]: [26565] flatPlus: Insert char at 8 Feb 27 11:08:42 yavdr-vbox vdr[26565]: [26565] flatPlus: Insert char at 18 Feb 27 11:08:42 yavdr-vbox vdr[26565]: [26565] flatPlus: JustifyLine() InsertedFillChar after third loop (' '): 2 Feb 27 11:08:42 yavdr-vbox vdr[26565]: [26565] flatPlus: JustifyLine() [Line: 10 Space, 708 width] [FillChar: 4 needed, 0 blocksize, 4 remainder, 10 width] [FillChars: 0 length] Feb 27 11:08:42 yavdr-vbox vdr[26565]: [26565] flatPlus: Insert char at 8 Feb 27 11:08:42 yavdr-vbox vdr[26565]: [26565] flatPlus: Insert char at 13 Feb 27 11:08:42 yavdr-vbox vdr[26565]: [26565] flatPlus: Insert char at 26 Feb 27 11:08:42 yavdr-vbox vdr[26565]: [26565] flatPlus: Insert char at 37 Feb 27 11:08:42 yavdr-vbox vdr[26565]: [26565] flatPlus: JustifyLine() InsertedFillChar after third loop (' '): 4 Feb 27 11:08:42 yavdr-vbox vdr[26565]: [26565] flatPlus: JustifyLine() [Line: 11 Space, 713 width] [FillChar: 4 needed, 0 blocksize, 4 remainder, 10 width] [FillChars: 0 length] Feb 27 11:08:42 yavdr-vbox vdr[26565]: [26565] flatPlus: Insert char at 7 Feb 27 11:08:42 yavdr-vbox vdr[26565]: [26565] flatPlus: Insert char at 14 Feb 27 11:08:42 yavdr-vbox vdr[26565]: [26565] flatPlus: Insert char at 22 Feb 27 11:08:42 yavdr-vbox vdr[26565]: [26565] flatPlus: Insert char at 38 Feb 27 11:08:42 yavdr-vbox vdr[26565]: [26565] flatPlus: JustifyLine() InsertedFillChar after third loop (' '): 4
Das muss irgendwas mit Unicode und UTF-8 zu tun haben. Ich könnt eLeerzeichen verwenden, aber die sind 5 Pixel breit. Das Hair Space dürfte eher im Bereich von einem oder zwei Pixel liegen und würde auch ein optisch gutes Ergebnis liefern.
Vielleicht hat jemand ne Idee warum das nicht klappt?
-
Wie muss ich das nun verändern, um nach mehreren Mustern zu suchen?
Oder gibt es eine bessere Alternative?
Ich hätte gerne die Möglichkeit das mit einem Skript zu machen:
Das Skript durchsucht die DB nach Eintragen, bei denen epi_season leer ist und sucht dann die Daten im sub_shorttext oder der Beschreibung und fügt die Werte dann in die DB ein.
-
Hier mal Beispiele wie im copy2usb.sh Skript, als Beispiel wie Warnungen oder Fehler ausgegeben werden
Codef_svdrpsend MESG "%Aufnahme \"${TITLE}\" wird gerade kopiert. Abbruch!" f_svdrpsend MESG "@Ungültiger Parameter <${1}> oder kein USB-Laufwerk gefunden!"
Das erste Zeichnen dient zur Festlegung des Meldungstyp.
Wenn VDR das nicht unterstützt, wird das Zeichen entfernt und die Meldung als Info-Meldung ausgegeben
-
Mir fehlt schon relativ lange die Möglichkeit am VDR Nachrichten abzusetzen, die Außer Info auch als Warnung oder Fehler angezeigt werden. Jetzt habe ich einen Patch geschrieben, der einen neuen Befehl einführt: MSGT (MessageType) - Analog zu MESG (Message)
Man kann die Meldungsfarbe beeinflussen, in dem man den ersten Buchstaben auf '%' für Warnung oder '@' für Fehler setzt. Der Patch ist angehängt.
Damit alte Skripte kompatibel bleiben, wird an MESG nichts verändert. Wenn Skripte den neuen Befehl verwenden wollen, müssen diese natürlich prüfen, ob der VDR das unterstützt.
Dazu habe ich ein Beispiel:
Code
Alles anzeigenf_svdrpsend() { if [[ "${1^^}" == 'MESG' ]] ; then mapfile -t < <("$SVDRPSEND" MSGT "${@:2}") # Prüfen ob VDR den Befehl kennt if [[ "${MAPFILE[1]}" == "500"* ]] ; then # MSGT nicht vorhanden : "${2#@}" ; clean_arg="${_#%}" # '%' oder '@' entfernen "$SVDRPSEND" MESG "$clean_arg" "${@:3}" fi else "$SVDRPSEND" "$@" # Für alles andere durchreichen fi }
Das geht auch viel einfacher, in dem man die Meldung absetzt und die Antwort auswertet und gegebenenfalls neu absetzt.Habe meine Idee mit kls diskutiert. Dabei sind verschiedene Ansätze entstanden, die alle Vor- und Nachteile haben:
- Neuer Befehl MSGT wie oben beschrieben. Alte Skripte bleiben kompatibel. Wer den neuen Befehl verwenden will muss prüfen, ob er im VDR vorhanden ist (Siehe Oben).
- MESG wir umgebaut und funktioniert wie MSGT. Alte Skripte bleiben kompatibel. Neue Skripte geben bei alten VDR das erste Zeichen mit aus (%Meldung).
- MESG mit der Variante Schlüsselwörter zu verwenden. Alte Skripte bleiben kompatibel. Neue Skripte geben bei alten VDR das Schlüsselwort mit aus (Warning: Meldung). Schlüsselwort wird nicht übersetzt.
Vor- und Nachteile:
1: + MESG bleibt unverändert. - Es muss geprüft werden, ob MSGT integriert ist.
2 und 3: + Kein neuer Befehl nötig. - Alte VDR geben zusätzliche Zeichen am Anfang aus (%, Warning:)
3: + Schlüsselwort ist "verständlich". - Schlüsselwort nur in Englisch
Nun die Frage, was am praktischen ist, bzw was für Meinungen es dazu gibt. Wie ist der Bedarf? Hat jemand weitere Vorschläge?
Mein Favorit wäre die 1.
-
Es geht nur um Sender, die keine ID haben und im Kurztext die Sxx Exx verstecken...
Ich denke es geht jetzt. Hab noch jeweils zwei Trim eingebaut.
Codecase when epi_season is Null then case when sub_shorttext is Null then '' else case when REGEXP_INSTR(sub_shorttext, 'S[0-9]+ ') = 0 then '' else concat('||Staffel: ', TRIM(LEADING '0' FROM TRIM(LEADING 'S' FROM REGEXP_SUBSTR(sub_shorttext, 'S[0-9]+')))) end end else concat('||Staffel: ', cast(epi_season as char)) end,
-
Bei einem Limit von 100000 hab ich dann Einträge erwischt:
Code8002862 26202 S19.2E-53-1105-4124 vdr 1707898100 P NULL NULL 81 1 Making the Soloist VR Free Solo am Les Drus in Frankreich S01 E02. Für Alex Honnold und Nico Hojac geht es ins Mont Blanc Massiv nach Frankreich, genauer zu einer Route des Les Druns. Für Alex Honnold und Nico Hojac geht es ins Mont Blanc Massiv nach Frankreich, genauer zu einer Route des Les Druns. Können sie am "Cerro Torre der Alpen" ihre Ziele in die Tat umsetzen? (2022) DVB 1708320000 1500 12 0 0x40, \n\nFür Alex Honnold und Nico Hojac geht es ins Mont Blanc Massiv nach Frankreich, genauer zu einer Route des Les Druns. Können sie am "Cerro Torre der Alpen" ihre Ziele in die Tat umsetzen? (2022)\n\nAltersempfehlung: ab 12\n\nStaffel: S01\n\nEpisode: E02\n\nEPG: DVB
Jetzt muss ich noch herausfinden, wie man das
noch bereinigt, damit am Ende auch Staffel: 1 rauskommt