hebcal / dotcom

deprecated hebcal.com source code
https://github.com/hebcal/hebcal-web
21 stars 9 forks source link

leyning details for sephardic #39

Closed roidayan closed 4 years ago

roidayan commented 4 years ago

Looking in aliyah.xml for example Bereshit https://github.com/hebcal/dotcom/blob/master/hebcal.com/dist/aliyah.xml

<parsha id="Bereshit" num="1"
 hebrew="בְּרֵאשִׁית"
 verse="Genesis 1:1 - 6:8"
 haftara="Isaiah 42:5 - 43:10" sephardic="Isaiah 42:5 - 42:21">

no matter if in the rest api i pass lg="s" it's still showing the Ashkenazis transliterations.

mjradwin commented 4 years ago

Good bug report. This will take a bit of effort to fix due to a clunky design. There is a static leyning calculation done in calc_triennial.pl which stages the result to a SQLite DB, and the API reads they leyning details from the DB.

roidayan commented 4 years ago

will it be quicker to just add "haftarah_sephardic" key to the json output ? then users can compare if that key exists then to use that.

mjradwin commented 4 years ago

This is fixed now, there is now a haftarah_sephardic part of the JSON output.

https://www.hebcal.com/hebcal?v=1&cfg=json&maj=off&s=on&lg=s&start=2020-10-17&end=2020-10-17

{
  "title": "Hebcal Diaspora October 2020",
  "date": "2020-09-21T16:33:56.400Z",
  "location": {
    "geo": "none"
  },
  "items": [
    {
      "title": "Parashat Bereshit",
      "date": "2020-10-17",
      "category": "parashat",
      "hebrew": "פרשת בראשית",
      "leyning": {
        "1": "Genesis 1:1 - 2:3",
        "2": "Genesis 2:4 - 2:19",
        "3": "Genesis 2:20 - 3:21",
        "4": "Genesis 3:22 - 4:18",
        "5": "Genesis 4:19 - 4:22",
        "6": "Genesis 4:23 - 5:24",
        "7": "Genesis 5:25 - 6:8",
        "torah": "Genesis 1:1-6:8",
        "haftarah": "I Samuel 20:18 - 20:42 | Shabbat Machar Chodesh",
        "haftarah_sephardic": "Isaiah 42:5 - 42:21",
        "maftir": "Genesis 6:5 - 6:8",
        "triennial": {
          "1": "Genesis 2:4 - 2:9",
          "2": "Genesis 2:10 - 2:19",
          "3": "Genesis 2:20 - 2:25",
          "4": "Genesis 3:1 - 3:21",
          "5": "Genesis 3:22 - 3:24",
          "6": "Genesis 4:1 - 4:18",
          "7": "Genesis 4:19 - 4:26",
          "maftir": "Genesis 4:23 - 4:26"
        }
      },
      "link": "https://www.hebcal.com/sedrot/bereshit-20201017?utm_source=js&utm_medium=api"
    }
  ]
}