Skip to content

Commit

Permalink
🚀 🐧 ✨ 📚 💄 🔨 🐛
Browse files Browse the repository at this point in the history
  • Loading branch information
jreina committed Dec 18, 2020
1 parent 8fc4617 commit 3f31e2d
Show file tree
Hide file tree
Showing 50 changed files with 1,333 additions and 366 deletions.
39 changes: 12 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
[![Bless](https://cdn.rawgit.com/LunaGao/BlessYourCodeTag/master/tags/ramen.svg)](http://lunagao.github.io/BlessYourCodeTag/)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)

## What this is?
A media server that runs on node.

## Why?
I wanted to stream media at home.
_A media server that runs on node._

## Dependencies
- ffmpeg - This server requires [ffmpeg](https://ffmpeg.zeranoe.com/builds/) to generate thumbnails, subtitles, and burn tracks. Install [ffmpeg](https://ffmpeg.zeranoe.com/builds/) and place it in your path.
Expand All @@ -21,22 +17,12 @@ npm install -g merriman

## Usage

### Configuring server
```bash
merriman editconfig
```

### Running the server
```bash
merriman run config.json
```

### Adding media
```bash
merriman initdir config.json c:\users\movies
```

## Sample configuration file
### Sample configuration file
```json
{
"mediaLocation": "c:\\media\\", // where uploaded media gets stored
Expand All @@ -46,22 +32,21 @@ merriman initdir config.json c:\users\movies
"connectionString": "mongodb://127.0.0.1", // MongoDB connection string
"database": "Movies" // The name of the database to store items in
},
"port": 80 // The port to bind to. Might require admin/sudo for <3000
"port": 80, // The port to bind to. Might require admin/sudo for <3000
"allowUnsafeFileAccess": false // Setting true allows a superadmin to traverse the filesystem from the UI
}
```

## Developing

Once [ffmpeg](https://ffmpeg.zeranoe.com/builds/) is installed, you must run the client and the server.

```bash
npm install
npm run server:watch # starts the server
```
and in a separate shell
```bash
npm start # starts the UI
```
1. Start an instance of MongoDB.
1. Install ffmpeg
1. Create a directory to house uploaded media
1. Create a directory to house uploaded thumbnails
1. Configure the connection string, media, and thumbnail paths in [the development config](./server-config.dev.json)
1. run `npm install`
1. run `npm run server:watch` to start the server
1. run `npm start` to start the UI

## Libraries
- Inversify - Used for dependency injection
Expand Down
224 changes: 222 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,15 @@
"passport-local": "^1.0.0",
"ramda": "^0.25.0",
"react": "^16.13.1",
"react-cast-sender": "^0.1.8",
"react-dom": "^16.13.1",
"react-icons": "^3.2.2",
"react-image-fallback": "^8.0.0",
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
"react-scripts": "3.4.3",
"react-spinners": "^0.9.0",
"react-toastify": "^6.2.0",
"reactstrap": "^6.0.1",
"reflect-metadata": "^0.1.13",
"typescript": "^3.7",
Expand Down
6 changes: 5 additions & 1 deletion scripts/add-media-info.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { MongoClient } = require('mongodb');
const moment = require('moment');

const dbName = 'development';
const dbName = 'Movies';

/**
* Change created and updated to createdAt and updatedAt on media items
Expand All @@ -17,6 +17,10 @@ async function addMediaInfo() {
item.updatedAt = moment(item.updated).toDate();
delete item.created;
delete item.updated;

item.path = item.path
? item.path
: 'F:\\Portable\\everything\\media-server\\';
});

await db.collection('media-migrated').insertMany(media);
Expand Down
Loading

0 comments on commit 3f31e2d

Please sign in to comment.