Explorar o código

convert here-files to actual patch files to make recreating easier

Daniel Sheffield %!s(int64=2) %!d(string=hai) anos
pai
achega
021e8b968c
Modificáronse 4 ficheiros con 105 adicións e 111 borrados
  1. 2 4
      Readme.md
  2. 2 107
      epg-grab-mjh.sh
  3. 48 0
      remove.patch
  4. 53 0
      rename.patch

+ 2 - 4
Readme.md

@@ -12,7 +12,7 @@ NOTE: I'm not actually sure if this is necessary, but the channel scan I did wit
 
 # Usage
 
-First, check the patches (included in the bash script as here-files) are appropriate for your use case.
+First, check the patches ``rename.patch`` and ``remove.patch`` are appropriate for your use case.
 
 Then run:
 ```bash
@@ -50,6 +50,4 @@ diff -u epg.xml epg-modified.xml > rename.patch
 diff -u epg.xml epg-modified.xml > remove.patch
 ```
 
-7. Replace the here-files in the bash script with your patch files
-
-I split the patches up in the case that some users neeed renames but not removals.
+The modifications are split up in the case that some users neeed renames but not removals.

+ 2 - 107
epg-grab-mjh.sh

@@ -4,111 +4,6 @@ EPGGZ=epg.xml.gz
 EPG="${EPGGZ%.gz}"
 curl -sL https://i.mjh.nz/nz/epg.xml.gz > "$EPGGZ"
 gunzip -f "$EPGGZ"
-patch -s <<EOF
-# rename channels
---- a/epg.xml	2022-12-26 09:13:51.480782463 +1300
-+++ b/epg.xml	2022-12-26 09:13:54.284849347 +1300
-@@ -14,13 +14,13 @@
-     <display-name>Bravo</display-name>
-   </channel>
-   <channel id="mjh-maori-tv">
--    <display-name>Whakaata Māori</display-name>
-+    <display-name>Whakaata Maori</display-name>
-   </channel>
-   <channel id="mjh-tvnz-duke">
--    <display-name>DUKE</display-name>
-+    <display-name>TVNZ DUKE</display-name>
-   </channel>
-   <channel id="mjh-tvnz-2-plus1">
--    <display-name>TVNZ 2 plus 1</display-name>
-+    <display-name>TVNZ 2 +1</display-name>
-   </channel>
-   <channel id="mjh-eden">
-     <display-name>eden</display-name>
-@@ -32,7 +32,7 @@
-     <display-name>PRIME</display-name>
-   </channel>
-   <channel id="mjh-tvnz-1-plus1">
--    <display-name>TVNZ 1 plus 1</display-name>
-+    <display-name>TVNZ 1 +1</display-name>
-   </channel>
-   <channel id="mjh-tvnz-duke-plus1">
-     <display-name>TVNZ DUKE+1</display-name>
-@@ -41,7 +41,7 @@
-     <display-name>ThreePlus1</display-name>
-   </channel>
-   <channel id="mjh-rush-nz">
--    <display-name>RUSH</display-name>
-+    <display-name>Rush</display-name>
-   </channel>
-   <channel id="mjh-te-reo">
-     <display-name>Te Reo</display-name>
-@@ -65,13 +65,13 @@
-     <display-name>Hope Channel</display-name>
-   </channel>
-   <channel id="mjh-chinese-tv28">
--    <display-name>Chinese TV28</display-name>
-+    <display-name>ChineseTV</display-name>
-   </channel>
-   <channel id="mjh-chinese-tv29">
-     <display-name>Chinese TV29</display-name>
-   </channel>
-   <channel id="mjh-parliament-tv">
--    <display-name>Parliament TV</display-name>
-+    <display-name>Parliament</display-name>
-   </channel>
-   <channel id="mjh-apna-television">
-     <display-name>APNA Television</display-name>
-EOF
-patch -s --fuzz=3 <<EOF
-# remove channels
---- a/epg.xml	2022-12-26 09:17:53.286555154 +1300
-+++ b/epg.xml	2022-12-26 09:17:57.098646238 +1300
-@@ -67,45 +67,12 @@
-   <channel id="mjh-chinese-tv28">
-     <display-name>ChineseTV</display-name>
-   </channel>
--  <channel id="mjh-chinese-tv29">
--    <display-name>Chinese TV29</display-name>
--  </channel>
-   <channel id="mjh-parliament-tv">
-     <display-name>Parliament</display-name>
-   </channel>
--  <channel id="mjh-apna-television">
--    <display-name>APNA Television</display-name>
--  </channel>
--  <channel id="mjh-panda-tv">
--    <display-name>Panda TV</display-name>
--  </channel>
--  <channel id="mjh-wairarapa-tv">
--    <display-name>Wairarapa TV</display-name>
--  </channel>
--  <channel id="mjh-trackside-1">
--    <display-name>TAB Trackside 1</display-name>
--  </channel>
--  <channel id="mjh-trackside-2">
--    <display-name>TAB Trackside 2</display-name>
--  </channel>
-   <channel id="mjh-ch200">
-     <display-name>CH200</display-name>
-   </channel>
--  <channel id="mjh-juice-tv">
--    <display-name>Juice TV</display-name>
--  </channel>
--  <channel id="mjh-tvsn-shopping">
--    <display-name>TVSN Shopping</display-name>
--  </channel>
--  <channel id="mjh-redbull-tv">
--    <display-name>Redbull TV</display-name>
--  </channel>
--  <channel id="mjh-channel-news-asia">
--    <display-name>Channel News Asia (CNA)</display-name>
--  </channel>
--  <channel id="mjh-metv">
--    <display-name>MeTV</display-name>
--  </channel>
-   <programme start="20221225063500 +0000" stop="20221225072500 +0000" channel="mjh-tvnz-1">
-     <title>Alan Carr's Epic Christmas Gameshow</title>
-     <sub-title>The Price Is Right: Christmas Special</sub-title>
-EOF
+patch -s < rename.patch
+patch -s --fuzz=3 < remove.patch
 mythfilldatabase --file --sourceid --xmlfile "$EPG"

+ 48 - 0
remove.patch

@@ -0,0 +1,48 @@
+--- a/epg.xml	2022-12-26 09:17:53.286555154 +1300
++++ b/epg.xml	2022-12-26 09:17:57.098646238 +1300
+@@ -67,45 +67,12 @@
+   <channel id="mjh-chinese-tv28">
+     <display-name>ChineseTV</display-name>
+   </channel>
+-  <channel id="mjh-chinese-tv29">
+-    <display-name>Chinese TV29</display-name>
+-  </channel>
+   <channel id="mjh-parliament-tv">
+     <display-name>Parliament</display-name>
+   </channel>
+-  <channel id="mjh-apna-television">
+-    <display-name>APNA Television</display-name>
+-  </channel>
+-  <channel id="mjh-panda-tv">
+-    <display-name>Panda TV</display-name>
+-  </channel>
+-  <channel id="mjh-wairarapa-tv">
+-    <display-name>Wairarapa TV</display-name>
+-  </channel>
+-  <channel id="mjh-trackside-1">
+-    <display-name>TAB Trackside 1</display-name>
+-  </channel>
+-  <channel id="mjh-trackside-2">
+-    <display-name>TAB Trackside 2</display-name>
+-  </channel>
+   <channel id="mjh-ch200">
+     <display-name>CH200</display-name>
+   </channel>
+-  <channel id="mjh-juice-tv">
+-    <display-name>Juice TV</display-name>
+-  </channel>
+-  <channel id="mjh-tvsn-shopping">
+-    <display-name>TVSN Shopping</display-name>
+-  </channel>
+-  <channel id="mjh-redbull-tv">
+-    <display-name>Redbull TV</display-name>
+-  </channel>
+-  <channel id="mjh-channel-news-asia">
+-    <display-name>Channel News Asia (CNA)</display-name>
+-  </channel>
+-  <channel id="mjh-metv">
+-    <display-name>MeTV</display-name>
+-  </channel>
+   <programme start="20221225063500 +0000" stop="20221225072500 +0000" channel="mjh-tvnz-1">
+     <title>Alan Carr's Epic Christmas Gameshow</title>
+     <sub-title>The Price Is Right: Christmas Special</sub-title>

+ 53 - 0
rename.patch

@@ -0,0 +1,53 @@
+--- a/epg.xml	2022-12-26 09:13:51.480782463 +1300
++++ b/epg.xml	2022-12-26 09:13:54.284849347 +1300
+@@ -14,13 +14,13 @@
+     <display-name>Bravo</display-name>
+   </channel>
+   <channel id="mjh-maori-tv">
+-    <display-name>Whakaata Māori</display-name>
++    <display-name>Whakaata Maori</display-name>
+   </channel>
+   <channel id="mjh-tvnz-duke">
+-    <display-name>DUKE</display-name>
++    <display-name>TVNZ DUKE</display-name>
+   </channel>
+   <channel id="mjh-tvnz-2-plus1">
+-    <display-name>TVNZ 2 plus 1</display-name>
++    <display-name>TVNZ 2 +1</display-name>
+   </channel>
+   <channel id="mjh-eden">
+     <display-name>eden</display-name>
+@@ -32,7 +32,7 @@
+     <display-name>PRIME</display-name>
+   </channel>
+   <channel id="mjh-tvnz-1-plus1">
+-    <display-name>TVNZ 1 plus 1</display-name>
++    <display-name>TVNZ 1 +1</display-name>
+   </channel>
+   <channel id="mjh-tvnz-duke-plus1">
+     <display-name>TVNZ DUKE+1</display-name>
+@@ -41,7 +41,7 @@
+     <display-name>ThreePlus1</display-name>
+   </channel>
+   <channel id="mjh-rush-nz">
+-    <display-name>RUSH</display-name>
++    <display-name>Rush</display-name>
+   </channel>
+   <channel id="mjh-te-reo">
+     <display-name>Te Reo</display-name>
+@@ -65,13 +65,13 @@
+     <display-name>Hope Channel</display-name>
+   </channel>
+   <channel id="mjh-chinese-tv28">
+-    <display-name>Chinese TV28</display-name>
++    <display-name>ChineseTV</display-name>
+   </channel>
+   <channel id="mjh-chinese-tv29">
+     <display-name>Chinese TV29</display-name>
+   </channel>
+   <channel id="mjh-parliament-tv">
+-    <display-name>Parliament TV</display-name>
++    <display-name>Parliament</display-name>
+   </channel>
+   <channel id="mjh-apna-television">
+     <display-name>APNA Television</display-name>