From f3cff53f92bc49125fb97ccf752cf194e3e7a730 Mon Sep 17 00:00:00 2001 From: Nick White Date: Sat, 5 May 2007 18:41:23 +0000 Subject: Fixed media sorting bug, added date view to listings Fixed bug causing issues containing only media to not be sorted correctly Added display of issue date when -vv is passed with -l or -m git-archimport-id: getht@sv.gnu.org/getht--mainline--0.1--patch-26 --- src/cli.c | 9 ++++++++- src/mediaxml.c | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/cli.c b/src/cli.c index 51ba380..56ccc9d 100644 --- a/src/cli.c +++ b/src/cli.c @@ -33,6 +33,8 @@ void list_issues(iss ** issue, int no_of_issues, int verbose) { printf("[%i]\t", iss_no); printf("%s\n", issue[iss_no]->title); + if(verbose >= 2) + printf("Year: %i; Months: %i - %i\n",issue[iss_no]->date.year,issue[iss_no]->date.firstmonth,issue[iss_no]->date.lastmonth); if(verbose >= 1) { for(sec_no=0; sec_no<=issue[iss_no]->no_of_sections; sec_no++) @@ -65,6 +67,8 @@ void list_media(iss ** issue, int no_of_issues, int verbose) if(issue[iss_no]->no_of_media >= 0) { printf("%s\n", issue[iss_no]->title); + if(verbose >= 2) + printf("Year: %i; Months: %i - %i\n",issue[iss_no]->date.year,issue[iss_no]->date.firstmonth,issue[iss_no]->date.lastmonth); for(med_no=0; med_no <= (issue[iss_no]->no_of_media); med_no++, med_global++) { printf("[%i]\t", med_global); @@ -72,8 +76,11 @@ void list_media(iss ** issue, int no_of_issues, int verbose) if(verbose >= 1) { printf("\t%s\n", issue[iss_no]->media[med_no]->uri); - if(verbose >=2 && issue[iss_no]->media[med_no]->comment[0]!='\0') + if(verbose >=2) + { + if(issue[iss_no]->media[med_no]->comment[0]!='\0') printf("\t%s\n", issue[iss_no]->media[med_no]->comment); + } } } } diff --git a/src/mediaxml.c b/src/mediaxml.c index bcb2da1..02c2cad 100644 --- a/src/mediaxml.c +++ b/src/mediaxml.c @@ -240,7 +240,7 @@ iss ** parsemedia(char * filepath, iss ** issue, int * no_of_issues) xmlFreeDoc(media_file); - issuesort(issue, no_of_issues); + issuesort(issue, *no_of_issues); return issue; } -- cgit v1.2.3