Skip to content

Commit

Permalink
Fixed a bug on requesting radio stations without using the filters. B…
Browse files Browse the repository at this point in the history
…umped versions to 1.1.1
  • Loading branch information
walkero-gr committed May 15, 2021
1 parent 205af45 commit c89ad29
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 13 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
# Changelog
All notable changes to this project will be documented in this file.

## [1.1.1] - 2021-05-15
### Changed
- Changed the required oo.library version to 1.12

### Fixed
- Fixed a bug on requesting radio stations without using the filters
https://www.amigans.net/modules/xforum/viewtopic.php?post_id=125112#forumpost125112
https://www.amigans.net/modules/xforum/viewtopic.php?post_id=125171#forumpost125171

## [1.1.0] - 2021-05-13
### Added
- Added a message requester for messages to the user
Expand Down
Binary file modified MediaVault.cbp.info
Binary file not shown.
Binary file modified MediaVault.info
Binary file not shown.
3 changes: 3 additions & 0 deletions Project Notes
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ DONE - Move UPnP functions to separate source file
*********
FIXED - When ooNetwork is used I get some unfreed signals on exit
FIXED - ooNetwork truncates the return info, so for now only 5 items return. Now it shows 20 stations. Maybe I need to some kind of pagination, based on the scrollbar.
FIXED - A bug on requesting radio stations without using the filters
(https://www.amigans.net/modules/xforum/viewtopic.php?post_id=125112#forumpost125112 and
https://www.amigans.net/modules/xforum/viewtopic.php?post_id=125171#forumpost125171)


//// IDEAS
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ My plan for MediaVault is to create an application which users will use to:

Requirements
--------------------------
* oo.library v1.11 by Tuomas Hokka
* oo.library v1.12 by Tuomas Hokka
* jansson.library v2.12.1 by Simon Tyrrell
* AmigaAmp3 v3.29 by Thomas Wenzel

Expand Down Expand Up @@ -61,6 +61,10 @@ https://github.com/walkero-gr/mediavault/issues

Changelog
--------------------------
v1.1.1 - 2021-05-15
* Changed the required oo.library version to 1.12
* Fixed a bug on requesting radio stations without using the filters

v1.1.0 - 2021-05-13
* Added a message requester for messages to the user
* The "Discover" button changes to "Discover more" after the first search,
Expand Down
8 changes: 6 additions & 2 deletions aminet.readme
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Short: Discover online radio stations
Uploader: walkero@gmail.com (George Sokianos)
Author: walkero@gmail.com (George Sokianos)
Type: util/wb
Version: 1.1.0
Version: 1.1.1
Architecture: ppc-amigaos
Distribution: Aminet
Requires:
Expand Down Expand Up @@ -37,7 +37,7 @@ My plan for MediaVault is to create an application which users will use to:

Requirements
--------------------------
* oo.library v1.11 by Tuomas Hokka
* oo.library v1.12 by Tuomas Hokka
* jansson.library v2.12.1 by Simon Tyrrell
* AmigaAmp3 v3.29 by Thomas Wenzel

Expand Down Expand Up @@ -67,6 +67,10 @@ https://github.com/walkero-gr/mediavault/issues

Changelog
--------------------------
v1.1.1 - 2021-05-15
* Changed the required oo.library version to 1.12
* Fixed a bug on requesting radio stations without using the filters

v1.1.0 - 2021-05-13
* Added a message requester for messages to the user
* The "Discover" button changes to "Discover more" after the first search,
Expand Down
8 changes: 6 additions & 2 deletions os4depot.readme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: mediavault
description: Discover online radio stations
version: 1.1.0
version: 1.1.1
author: George Sokianos
submitter: George Sokianos
email: walkero@gmail.com
Expand Down Expand Up @@ -40,7 +40,7 @@ My plan for MediaVault is to create an application which users will use to:

Requirements
--------------------------
* oo.library v1.11 by Tuomas Hokka
* oo.library v1.12 by Tuomas Hokka
* jansson.library v2.12.1 by Simon Tyrrell
* AmigaAmp3 v3.29 by Thomas Wenzel

Expand Down Expand Up @@ -70,6 +70,10 @@ https://github.com/walkero-gr/mediavault/issues

Changelog
--------------------------
v1.1.1 - 2021-05-15
* Changed the required oo.library version to 1.12
* Fixed a bug on requesting radio stations without using the filters

v1.1.0 - 2021-05-13
* Added a message requester for messages to the user
* The "Discover" button changes to "Discover more" after the first search,
Expand Down
9 changes: 9 additions & 0 deletions src/gui.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ static void fillRadioList(BOOL newSearch)
STRPTR responseJSON = getRadioStations(lastFilters, offset);
if (responseJSON)
{
//IDOS->Printf("responseJSON\n%s\n==============================================\n", responseJSON);
getRadioList(responseJSON, offset);
if (radioListItemsCnt == 0)
{
Expand Down Expand Up @@ -446,6 +447,8 @@ static void playRadio(STRPTR stationUrl)
static BOOL checkFiltersChanged(void)
{
BOOL changed = FALSE;
static BOOL firstCheck = TRUE;

if (IUtility->Stricmp(lastFilters.name, prevFilters.name))
{
changed = TRUE;
Expand All @@ -463,6 +466,12 @@ static BOOL checkFiltersChanged(void)
changed = TRUE;
}

if (firstCheck)
{
firstCheck = FALSE;
changed = TRUE;
}

if (changed) prevFilters = lastFilters;

return changed;
Expand Down
6 changes: 3 additions & 3 deletions src/libshandler.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ void OpenLibs(void)

if ((OOBase=IExec->OpenLibrary("oo.library", 1 )))
{
if (LIB_IS_AT_LEAST(OOBase, 1, 9))
if (LIB_IS_AT_LEAST(OOBase, 1, 12))
{
IOO = (struct OOIFace *)IExec->GetInterface( OOBase, "main", 1, NULL );
if(!IOO) CleanExit("Can't open oo.library Interface");
}
else CleanExit("Can't open oo.library version 1.11 and above");
else CleanExit("Can't open oo.library version 1.12 and above");
}
else CleanExit("Can't open oo.library version 1.11 and above. Is it installed?");
else CleanExit("Can't open oo.library version 1.12 and above. Is it installed?");

if ((LayoutBase = (APTR) IIntuition->OpenClass( "gadgets/layout.gadget", 1, &LayoutClass )))
{
Expand Down
7 changes: 4 additions & 3 deletions src/radiofuncs.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ extern int32 radioListItemsCnt, radioTrendListItemsCnt, radioPopularListItemsCnt

STRPTR getRadioStations(struct filters lastFilters, int offset)
{
char url[255];
char url[255];
char maxResultsStr[4];

IUtility->Strlcpy(url, radioAPIUrl, sizeof(url));
Expand Down Expand Up @@ -121,7 +121,7 @@ void getRadioList(STRPTR jsonData, int offset)

if(!jsonRoot)
{
IDOS->Printf("json error: on line %d: %s\n", jsonError.line, jsonError.text);
//IDOS->Printf("json error: on line %d: %s\n", jsonError.line, jsonError.text);
CleanExit("JSON Error");
}

Expand All @@ -137,7 +137,7 @@ void getRadioList(STRPTR jsonData, int offset)
IExec->NewList(&radioList);
}
radioListItemsCnt = 0;

for(i = 0; i < IJansson->json_array_size(jsonRoot); i++)
{
struct Node *stationNode;
Expand Down Expand Up @@ -195,6 +195,7 @@ void getRadioList(STRPTR jsonData, int offset)
CleanExit("JSON Error");
}
//IDOS->Printf("Station url_resolved: %s\n", IJansson->json_string_value(url_resolved));


votes = IJansson->json_object_get(data, "votes");
if(!json_is_integer(votes))
Expand Down
4 changes: 2 additions & 2 deletions src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
#endif

#ifndef PATCH
#define PATCH 0
#define PATCH 1
#endif

#ifndef RELEASE_DATE
#define RELEASE_DATE "13.5.2021"
#define RELEASE_DATE "15.5.2021"
#endif

#define APPNAME "MediaVault"
Expand Down

0 comments on commit c89ad29

Please sign in to comment.