-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Faster import of resources in mod_ginger_adlib. (#703)
Also better reporting and debug logging during imports. Fixes for more robustness in m_creative_commons.erl, sparql_client.erl and filter_location_defined.erl
- Loading branch information
Showing
4 changed files
with
38 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
%% @author Driebit <[email protected]> | ||
%% @copyright 2015 Driebit | ||
%% @doc unique filter, return a list with unique ids | ||
%% @doc Check if a resource has a location_lat defined. | ||
%% | ||
%% Licensed under the Apache License, Version 2.0 (the "License"); | ||
%% you may not use this file except in compliance with the License. | ||
|
@@ -19,15 +19,21 @@ | |
-export([location_defined/2]). | ||
-include("zotonic.hrl"). | ||
|
||
has_location(undefined, _Context) -> | ||
false; | ||
has_location(RscId, Context) when is_integer(RscId) -> | ||
case m_rsc:p(RscId, location_lat, Context) of | ||
undefined -> | ||
false; | ||
<<>> -> | ||
false; | ||
_Lat -> | ||
true | ||
end; | ||
has_location({RscId, _}, Context) -> | ||
has_location(RscId, Context). | ||
has_location(RscId, Context); | ||
has_location(RscId, Context) -> | ||
has_location(m_rsc:rid(RscId, Context), Context). | ||
|
||
location_defined(Data, Context) -> | ||
List = filter_make_list:make_list(Data, Context), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters