Skip to content

Commit

Permalink
Change wiki from Fandom.com to Wiki.gg
Browse files Browse the repository at this point in the history
  • Loading branch information
jonesy-b-dev committed May 28, 2024
1 parent fd95fdf commit 6c7f1f4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,10 @@ Example:
## Contributing
Contribution is possible, just make a pull request with your changes!

## Change log
### Version 2.0
* Changed wiki from Fandom.com to Wiki.gg
* Fixed spelling mistake in code comment

## To Do
* Cleaning up
* Add option to choose between the Fandom.com wiki and the Wiki.gg wiki
6 changes: 3 additions & 3 deletions TerrariaWiki/Flow.Launcher.Plugin.TerrariaWiki/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ public class TerrariaWiki : IAsyncPlugin
private PluginInitContext _context;

// Define variabkes for the plugin to use
private readonly string base_url = "https://terraria.fandom.com/";
private readonly string base_url = "https://terraria.wiki.gg/";
private string query_url;
private string jsonResult;
private string finalUrl;

// Path to icon
private readonly string icon_path = "icon.png";

Check warning on line 22 in TerrariaWiki/Flow.Launcher.Plugin.TerrariaWiki/Main.cs

View workflow job for this annotation

GitHub Actions / build

The field 'TerrariaWiki.icon_path' is assigned but its value is never used

// Initialine query url
// Initialise query url
public async Task InitAsync(PluginInitContext context)

Check warning on line 25 in TerrariaWiki/Flow.Launcher.Plugin.TerrariaWiki/Main.cs

View workflow job for this annotation

GitHub Actions / build

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 25 in TerrariaWiki/Flow.Launcher.Plugin.TerrariaWiki/Main.cs

View workflow job for this annotation

GitHub Actions / build

Missing XML comment for publicly visible type or member 'TerrariaWiki.InitAsync(PluginInitContext)'
{
query_url = base_url + "api.php?action=query&list=search&srwhat=text&format=json&srsearch=";
Expand Down Expand Up @@ -69,7 +69,7 @@ public async Task<List<Result>> QueryAsync(Query query, CancellationToken token)
results.Add(new Result
{
Title = $"{item.title}",
SubTitle = $"https://terraria.fandom.com/wiki/" + itemWithunderscores,
SubTitle = base_url + "wiki/" + itemWithunderscores,
Action = e =>
{
// Make final url to search
Expand Down
2 changes: 1 addition & 1 deletion TerrariaWiki/Flow.Launcher.Plugin.TerrariaWiki/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Name": "TerrariaWiki",
"Description": "Plugin to search the Terraria wiki with",
"Author": "jonesy-b-dev",
"Version": "1.1.1",
"Version": "2.0",
"Language": "csharp",
"Website": "https://github.com/jonesy-b-dev/TerrariaWiki-flow-Plugin",
"IcoPath": "icon.png",
Expand Down

0 comments on commit 6c7f1f4

Please sign in to comment.