shemanaev / dotopds Goto Github PK
View Code? Open in Web Editor NEWLightweight .NET OPDS server
License: MIT License
Lightweight .NET OPDS server
License: MIT License
Use a reader (tested on Moon Reader Pro on Android).
Please see attached screenshots for details (1 - the last page but one, 2 - the "last" page).
FYI, I updated my repository with the working pdf tree importer. This uses iTextSharp to retrieve Info from pdf file.
It expects a Genre on command line for the top level. Each directory in the path to pdf file is added to the Genre list. Keywords, if any in the pdf, are indexed but not stored.
I would like to add to your implementation an Importer for pdf files. It would get meta data from the PDF file itself. I envisage using multiple source directories (I don't want to move the files from where they are located.) and recurse into them as deep as necessary.
Do I need to only implement something like LuceneImporter or do I need to change code elsewhere to allow choosing an Importer? E.g. in ImportTask.cs the importer is hardcoded to Lucene.
Right now you forced to delete imported library to avoid duplicates on re-import. That's definetly not the way to go.
Records should be updated on unique index (LibraryId + File + Ext + Archive) instead.
Use a reader (tested on Moon Reader Pro).
It's hard to add custom formats support right now. Consider adding plugin system for importers and parsers.
This behavior doesn't depend on a pagination specified in the config file (but of course you'll less likely get more that one page with larger pagination setting). Another interesting thing: when you try to get to specific page, it shows a number equal to actual page number - 1 (e.g. when you are on the first page it shows "0"), and if you enter e.g. "3" it tries to go to 2-nd page (but displays the same list as on 1-st page).
Using OPDSBrowser on Android, I am entering a Search for 'Harold', the author of one of my pdf files. This finds no result. The reason is that the search term 'harold' doesn't get passed. In fact the Request looks badly formatted. (I would try with Aldiko but there the Search button doesn't appear :-( ) I am guessing that {searchTerm} should be part of the initial page sent to the client?
The command screen for DotOPDS shows:
6362165145178012834 - Response: GET http://192.168.0.117:8080/opds
Content-Type: application/atom+xml; charset=utf-8
<feed xmlns:os="http://a9.com/-/spec/opensearch/1.1/" xmlns:opds="http://opds-spec.org/2010/catalog" xmlns:dc="http://purl.org/dc/terms/" xmlns:dotopds="urn:dotopds:v1.0" xmlns="http://www.w3.org/2005/Atom">
<updated>2017-02-02T21:57:31</updated>
<id>tag:root:root</id>
<title>DotOPDS Library</title>
<link rel="search" type="application/atom+xml" href="/opds/search?q={searchTerms}" />
<link rel="start" type="application/atom+xml;profile=opds-catalog;kind=navigation" href="/opds" />
<link rel="self" type="application/atom+xml;profile=opds-catalog;kind=navigation" href="/opds" />
<entry>
<updated>2017-02-02T21:57:31</updated>
<id>tag:root:genres</id>
<title>Books by genres</title>
<dc:issued>0</dc:issued>
<content type="text">Browse books by genres</content>
<link type="application/atom+xml;profile=opds-catalog;kind=acquisition" href="/opds/genres" />
</entry>
</feed>
6362165150697394674 - Request: GET http://192.168.0.117:8080/opds/search?q={searchTerms}&q=harold
User-Agent: Dalvik/1.6.0 (Linux; U; Android 4.4.2; SM-T310 Build/KOT49H)
Host: 192.168.0.117:8080
Connection: Keep-Alive
Accept-Encoding: gzip
Breakpointing in SearchController.cs in Feed Search I see q is {searchTerms}, not harold. The query of course finds nothing.
https://github.com/gerritv/DotOPDS/releases/tag/V0.1.0.1
This provides a general purpose document library tool for pdf files. Each file has a Cover (the file thumbnail) included in the index.
Use some language detection library (ntextcat) or directly specify language code in import command.
I need/want to add some web pages to the server. This will lead to using that web pages to show statistics of my libraries and to also Update/Remove etc. books and documents so I don't have to use Command window. To that end I added an empty index.html to the project. And then enhanced the webcontroller to support a general web site. If you issue http://:8080 it will get index.html (as default page)
public class WebController : ApiController
{
/// <summary>
/// Handles web site if present, otherwise redirects to /opds
/// </summary>
/// <param name="filename"></param>
/// <returns>Http Response message</returns>
//[Route("{*filename}")]
[HttpGet]
public HttpResponseMessage ServeIndex(string filename)
{
var file = GetFile("index.html");
if (filename == null)
{
if (file == null)
{
file = Request.CreateResponse(HttpStatusCode.Moved);
file.Headers.Location = new Uri("/opds", UriKind.Relative);
}
else
{
return file;
}
}
else
{
if ((file = GetFile(filename)) == null)
{
file = Request.CreateResponse(HttpStatusCode.NotFound);
}
}
return file;
}
Bad input file
with latest lib.rus.ec dump. MyHomeLib with the same file works fine.
cmd:
DotOPDS.exe import D:\library librusec_local_fb2.inpx
Any ideas?
DotOPDS v1.0.8-7b980a8-master, win 8.1 x64.
I am trying to fit my needs in with the existing structures to avoid making too many code changes.
My document trees are of the form e.g.:
\CircularStore\eBooks\Cooking\Chinese\Dim Sum\ or
\CircularStore\eBooks\Machining\Tools\Tool to Make\
I am thinking that if I add a Root parameter to my pdf importer I could end up with a Genre list using \CircularStore\eBooks as Root. The Genre list could then be parsed from the remaining directory structure. The top level would have category_ prepended
category_Cooking
Chinese
Dim Sum
Keep in mind that I will be extracting (already have this working) the list of Genre actually used from the Index. I have the top level working, I use IndexReader to get all the Genre and pull out the category_ ones for the top level. I have no reasonable other way to infer Genre/Category from the Pdf files.
Is that along the lines of the two or more level Genre you have implemented?
There are a lot of unnescessary fields that really doesn't matter for almost anyone.
Maybe there should be somthing like 'meta' fields. Some indexed key-value fields under meta.
namespace, so it'll be searchable with query like meta.language:ru
.
It can be placed under custom namespace tag in OPDS model (like series
field in FeedEntry
).
Fields like Size
, LibId
, Del
, Language
, Keywords
can be placed there.
Any chance to make a fresh GitHub release as well as publish it on Docker Hub?
It's stored in settings, that's just wrong.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.