Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 71 lines (63 sloc) 3.778 kb
<!--#set var="title" value="Playdar - Music Content Resolving Framework" --><!--#include virtual="/inc/header.html" -->
<h2>Playdar Content Resolving Framework</h2>
<p>
Playdar has an asynchronous cascading resolver pipeline. Resolvers with the highest weighting are queried first, and the search is quickly passed on to other resolvers in the chain until a match is found. As soon as a query is "solved", the pipeline is aborted.
</p>
<p>
Resolver plugins are loaded into the pipeline with a <b>weight</b> and <b>target time</b>.
The weight is an int between 1-100, and dictates the order in which resolver plugins are queried. The most reliable and fastest resolver has a weight of 100 (ie the one that matches files on your hard disk).
</p>
<p>
The target time is a millisecond value that the resolver will probably have found results in, if any exist. If a query is still not solved after the target time has elapsed, the query is dispatched to the resolver with the next highest weight.
</p>
<p>
Results are still valid if reported after the targettime, it's simply used to decide when to hit up the next resolver.
This helps cut down on spam. There's no point in querying the entire internet if you find a result on your hard disk.
</p>
<p>
<strong>Resolvers with equal weights are dispatched to in parallel</strong>, and the smallest targettime of resolvers at that weight is used to decide when to dispatch the query to the next resolver(s).
</p>
<h3>Resolvers</h3>
<p>
Currently the local-files resolver and the LAN resolver are fully supported and built by default. This allows you to find files on your hard disk, and from other machines running playdar on your home network.
</p>
<p>
There are other scripts and plugins available in the contrib/ directory. An example of an external resolver script (writen in PHP) is the magnatune resolver - this resolves against the free online record label magnatune.com. There is also a script that resolves against mp3tunes (an online music locker service), and many others.
</p>
<h3>Write your own Resolver Plugin</h3>
<p>
To write additional resolvers that find content from other sources you have two options:
<ul>
<li>
Any scripting language or other program can be spawned as an external process,
which Playdar talks to by writing to stdin and reading stdout. You need to parse requests to stdin (JSON objects)
and write any results to stdout (also as JSON objects). Playdar does the rest for you.
Example: <a href="http://github.com/RJ/playdar-core/tree/master/contrib/demo-script">demo resolver PHP script</a>
</li>
<li>
Writing a module in Erlang and defining the playdar_resolver behaviour.
A simple Erlang resolver looks like this: <a href="http://github.com/RJ/playdar-core/blob/master/playdar_modules/fake/src">fake_resolver (Erlang)</a>.
For slightly more complex examples, check the lan or library modules from the <a href="http://github.com/RJ/playdar-core/blob/master/playdar_modules">playdar_modules dir</a>.
</li>
</ul>
Consider joining the mailing list or IRC if you are writing a resolver, we'd love to hear about it.
</p>
<h3>Other resolver plugins...</h3>
<p>
What other sources can you think of to resolve music from?
</p>
<p>
Here are some ideas:
</p>
<ul>
<li>Searching free sources such as magnatune.com or archive.org</li>
<li>Got a paid-for Rhapsody or Spotify account? Write a resolver plugin or script to use it.</li>
<li>iTunes shared libraries (not sure if this is possible due to silly encryption apple added?)</li>
<li>UPnP Media Devices</li>
<li>Ampache (starting point for this already in contrib/)</li>
<li>Any online service that has a search/streaming API</li>
<li><b>Your idea here</b></li>
</ul>
</p>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.