rahul-gaidhane / project_mag

0 stars 0 forks source link

add issue metadata file #9

Open satyanash opened 6 years ago

satyanash commented 6 years ago

We need a way to add extra metadata to an issue manually. This will allow us to add things like publication dates, issue names etc without having to parse the PDF/TIFF using a program.

The metadata may or may not be present in the form of a text file with the same name as the TIFF/PDF file. If this file exists, the data inside the file should be read and displayed inside the generated HTML pages.

Initially this text file may contain the following metadata for every issue:

Your program will parse this file and display the publication date and issue number at the top of the page that shows all the pages in a given issue.

satyanash commented 6 years ago

The text file will need to have a well defined structure so that it can be read and written by a program. You may use any one of the following formats:

rahul-gaidhane commented 6 years ago

Does metadata file needs to be generated automatically ?

satyanash commented 6 years ago

No. The metadata will be a part of the input. Our program will not generate the metadata. It will simply read it and then display it inside the generated HTML files.

rahul-gaidhane commented 6 years ago

so we will provide the publication month & year.

satyanash commented 6 years ago

Yes, the metadata files will be written by us for now.

rahul-gaidhane commented 6 years ago

separate meta data file for each issue.it will contain the publication month&year, total number of pages.

satyanash commented 6 years ago

Yes. We will manually hand-write this data into the metadata files. For now we will keep the filename same as the issue for which it contains the data. Only the extension will be different.

satyanash commented 6 years ago

For testing you need to do this only for a few files since our program should still generated the output even if the metadata file does not exist as mentioned above.

satyanash commented 6 years ago

Update on this.

rahul-gaidhane commented 6 years ago

I wrote metadata files having fields issuemonth, issueyear, maxpages in json syntax.I use jq to parse through the json file for a particular issue.

satyanash commented 6 years ago

Please push code before commenting. I don't see anything related to this issue.

rahul-gaidhane commented 6 years ago

code is pushed along with metafiles.

satyanash commented 6 years ago

If the metadata file for a given input file does not exist, your program will give the following warning:

jq: error: Could not open file META_FILES/Dec.1991-Aank9.json: No such file or directory

As I had mentioned in the first comment:

The metadata may or may not be present in the form of a text file with the same name as the TIFF/PDF file. If this file exists, the data inside the file should be read and displayed inside the generated HTML pages.

satyanash commented 6 years ago

You need to handle both the cases.

satyanash commented 6 years ago

Update on this?

rahul-gaidhane commented 6 years ago

not worked on it. Should we make meta files for other years publications too ?

satyanash commented 6 years ago

For now, let us not. We need to be handle both cases anyway. :)

rahul-gaidhane commented 6 years ago

I have fixed the issue. 1.Error message which was shown when meta file is not present is suppressed using 2>/dev/null. 2.earlier when error occurred ISSUEMONTH and ISSUEYEAR variables where left empty.Now I have put some general text in it.