67 Commits

Author SHA1 Message Date
Justin Maggard
2301120dd0 inotify: Dynamically increase inotify max watches
If we run out of inotify watches, try dynamically increasing the limit.
2017-02-14 23:54:33 -08:00
Justin Maggard
44f06f4557 inotify: Declare private functions static 2017-02-14 23:24:16 -08:00
Justin Maggard
abc1972600 inotify: fix SQL error when moving captions
Change INSERT to INSERT OR REPLACE when recording caption file moves,
to avoid UNIQUE constraint failures.
2016-03-17 14:48:05 -07:00
Darkvater
910b84bcd6 inotify: missing include file 2016-03-17 14:48:05 -07:00
Justin Maggard
c985eee9c7 inotify: Block signals in the inotify thread.
Otherwise, we may get invalid reads due to double-handling of signals.
2015-12-21 11:43:38 -08:00
Justin Maggard
5a309fc48f inotify: Recognize new hard links.
Based on SF patch #139 (Thanks Alenky Klaus).
2015-07-30 14:54:39 -07:00
Justin Maggard
a294f624e0 inotify: Fix new video file detection for TYPE_AUDIO|TYPE_VIDEO media_dirs.
We were missing a return in one of the cases for the switch.

Patch #150 from user Shrimpkin.
Fixes: Support Request #40 (Inotify don't work when add *.mts video)
2015-06-26 00:03:31 -07:00
Justin Maggard
61bb91ecc9 scanner: check defined media types before parsing files 2014-04-28 16:01:30 -07:00
Justin Maggard
381c4805e6 subtitles: accept smi in addition to srt 2014-04-21 15:44:39 -07:00
Justin Maggard
331d484555 utils: add noalloc flag to modifyString()
This should make it more straightforward for code analyzers to
tell if the function is going to allocate memory.
2014-04-18 15:18:44 -07:00
Catalin Patulea
3a57744735 Add printf attribute to log_err/DPRINTF and fix a few warnings
Modified to not use %z for portability reasons.
2014-04-10 18:57:30 -07:00
Justin Maggard
d492b43ef8 Fix various potential illegal access and memory leaks in error conditions. 2014-04-07 11:20:19 -07:00
Justin Maggard
bb163eb65f Fix various inotify issues with deleting entire folder contents, and then re-adding content back to the same folder. This should be the cause of '(null)' folder names. 2013-09-18 15:29:59 -07:00
Justin Maggard
584258c1f8 * Add support for limiting a media dir to multiple media types. 2012-10-03 07:26:00 +00:00
Justin Maggard
fdcdd9ded8 * Fix inotify parsing of new video symlinks. (SF bug #3552473) 2012-08-20 21:30:16 +00:00
Justin Maggard
b15a5d144d * Move SearchCriteria parsing to its own function. 2012-07-28 01:17:30 +00:00
Justin Maggard
61fbce18ba * Replace sqlite_int64 with int64_t in many places, to better allow for the possibility of other databases. (Thanks Douglas Carmichael) 2012-06-29 23:14:27 +00:00
Justin Maggard
29738ed064 * Correctly proccess paths with brackets. 2012-03-28 06:43:28 +00:00
Justin Maggard
ef70eada7d * Fix inotify detection of caption file removal. 2012-01-31 01:17:00 +00:00
Justin Maggard
08172a4ed2 * Enhance error checking in some additional places as required by the latest UPnP CTT. 2012-01-21 01:00:26 +00:00
Justin Maggard
6eb9cc7054 * Fix a strange SQL error adding watches, and clean up some warnings. 2012-01-10 02:48:24 +00:00
Justin Maggard
0919e28b3a * Fix inotify detection issue on first-level folders. 2011-12-26 10:14:21 +00:00
Justin Maggard
9a325e04b0 * Fix up inotify autoconf support. 2011-09-21 21:55:56 +00:00
Justin Maggard
773e1f6566 * Add support for other operating systems (kFreeBSD, FreeBSD, and OSX for now).
* Switch to autoconf from genconfig.sh.
2011-09-16 23:39:58 +00:00
Justin Maggard
e95ab8beef * Fix inotify handling of playlist modifications. (SF bug #3288710) 2011-07-29 22:41:26 +00:00
Justin Maggard
9a9270cecf * Fix some issues reported by cppcheck. 2011-05-02 23:50:52 +00:00
Justin Maggard
88b992bd51 * Escape video tags. 2011-04-21 08:50:44 +00:00
Justin Maggard
a8d204dd0d * Do no add inaccessible directories to the database. (Thanks Ivan Mironov) 2011-04-08 02:16:15 +00:00
Justin Maggard
bbdc5cc070 * Add a missing newline for one log message. 2011-04-04 22:20:39 +00:00
Justin Maggard
f939dd924d * Properly scan newly created directory symlinks. 2011-02-18 23:13:48 +00:00
Justin Maggard
f05509eaf9 * Fix copy/paste error. 2010-12-25 18:00:40 +00:00
Justin Maggard
17ec930fa1 * Detect new or changed symlinks in addition to regular files. 2010-12-21 00:17:27 +00:00
Justin Maggard
8e0fcd56f9 * Complete/clarify license information. 2010-11-11 23:48:14 +00:00
Justin Maggard
263b93fb92 * Break out earlier if we see a CLOSE_WRITE, but the file hasn't changed. 2010-09-28 07:59:11 +00:00
Justin Maggard
6b1ae89af6 * Skip hidden entries when scanning newly found directories. 2010-06-03 21:56:53 +00:00
Justin Maggard
346ff6e293 * Add M3U/PLS music playlist support. 2010-01-13 21:15:26 +00:00
Justin Maggard
953142080c * Missed one place for the recent db_path change. (Thanks stedy6!) 2009-11-19 18:34:42 +00:00
Justin Maggard
c8fe23d838 * Rework the sql_exec function to use format arguments, to simplfy the code.
* Don't set the DB version until after the scan completes.  This way, if only a partial scan has been done, a full scan will be initiated the next time minidlna is started.
2009-11-04 01:38:14 +00:00
Justin Maggard
6738b8a722 * Fix bug from the previous checkin. 2009-11-02 19:47:57 +00:00
Justin Maggard
58ecfd6380 * Implement and use new sql_get_int_field() function to simplify getting integers from the database. 2009-11-02 19:21:38 +00:00
Justin Maggard
0f0d22c2f5 * Update database entries if inotify catches a file CLOSE_WRITE and the modify time is newer than the last recorded time in the database. 2009-10-23 02:38:42 +00:00
Justin Maggard
590f0761f4 * Fix Samba copy errors with inotify enabled. 2009-10-23 01:02:40 +00:00
Justin Maggard
f7e525019a * Add SRT subtitle support using Samsung's method. 2009-10-15 00:40:27 +00:00
Justin Maggard
ba29e35bcc * Clean up after some memory allocations before exit so valgrind is happy.
* Fork off the scanner process instead of doing it in another thread, so if libavformat leaks memory it will be cleaned up once scanning is finished.
2009-10-03 02:08:59 +00:00
Justin Maggard
b1f4c35017 * If a new file is noticed by inotify, check if it is cover art for existing files, and update them if so. 2009-07-08 19:20:32 +00:00
Justin Maggard
1c7c19f796 * Read configuration to determine which inotify header to use. 2009-06-26 19:07:15 +00:00
Justin Maggard
7071e79f3f * Don't try reading info from a new file if that new file has no size. 2009-06-17 19:25:12 +00:00
Justin Maggard
a295b448ba * To my surprise, XFS doesn't support dt_type in readdir results, so we need to stat each entry of type DT_UNKNOWN. 2009-06-04 22:32:10 +00:00
Justin Maggard
567558f54b * Logging is more helpful when you log which files an error occured on... 2009-05-23 02:26:45 +00:00
Justin Maggard
2e27960e10 * Fix another inotify error condition when copying files to the root of the content directory. 2009-05-11 18:31:48 +00:00