-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
-Revamped local items to display more information such as service nam…
…e, etc. -Enabled reordering, renaming, removing of items on playlist fragment. -Enabled removal of dangling streams entries when history is cleared. -Changed playlist append menu item to icon on service player activity. -Added adapter and builder for local items, removed dependency on infoitem and existing infolist for database entry items. -Removed watch history entity and DAO. -Extracted info item selected listener to remove adding boilerplate code when long click functionality is optional. -Fixed query returning no record on left join when right table is empty.
- Loading branch information
Showing
38 changed files
with
1,224 additions
and
506 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
app/src/main/java/org/schabi/newpipe/database/LocalItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package org.schabi.newpipe.database; | ||
|
||
public interface LocalItem { | ||
enum LocalItemType { | ||
PLAYLIST_ITEM, | ||
PLAYLIST_STREAM_ITEM, | ||
STATISTIC_STREAM_ITEM | ||
} | ||
|
||
LocalItemType getLocalItemType(); | ||
} |
37 changes: 0 additions & 37 deletions
37
app/src/main/java/org/schabi/newpipe/database/history/dao/WatchHistoryDAO.java
This file was deleted.
Oops, something went wrong.
109 changes: 0 additions & 109 deletions
109
app/src/main/java/org/schabi/newpipe/database/history/model/WatchHistoryEntry.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
app/src/main/java/org/schabi/newpipe/database/playlist/PlaylistStreamEntry.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package org.schabi.newpipe.database.playlist; | ||
|
||
import android.arch.persistence.room.ColumnInfo; | ||
|
||
import org.schabi.newpipe.database.LocalItem; | ||
import org.schabi.newpipe.database.playlist.model.PlaylistStreamEntity; | ||
import org.schabi.newpipe.database.stream.model.StreamEntity; | ||
import org.schabi.newpipe.extractor.stream.StreamInfoItem; | ||
import org.schabi.newpipe.extractor.stream.StreamType; | ||
|
||
public class PlaylistStreamEntry implements LocalItem { | ||
@ColumnInfo(name = StreamEntity.STREAM_ID) | ||
final public long uid; | ||
@ColumnInfo(name = StreamEntity.STREAM_SERVICE_ID) | ||
final public int serviceId; | ||
@ColumnInfo(name = StreamEntity.STREAM_URL) | ||
final public String url; | ||
@ColumnInfo(name = StreamEntity.STREAM_TITLE) | ||
final public String title; | ||
@ColumnInfo(name = StreamEntity.STREAM_TYPE) | ||
final public StreamType streamType; | ||
@ColumnInfo(name = StreamEntity.STREAM_DURATION) | ||
final public long duration; | ||
@ColumnInfo(name = StreamEntity.STREAM_UPLOADER) | ||
final public String uploader; | ||
@ColumnInfo(name = StreamEntity.STREAM_THUMBNAIL_URL) | ||
final public String thumbnailUrl; | ||
@ColumnInfo(name = PlaylistStreamEntity.JOIN_STREAM_ID) | ||
final public long streamId; | ||
@ColumnInfo(name = PlaylistStreamEntity.JOIN_INDEX) | ||
final public int joinIndex; | ||
|
||
public PlaylistStreamEntry(long uid, int serviceId, String url, String title, | ||
StreamType streamType, long duration, String uploader, | ||
String thumbnailUrl, long streamId, int joinIndex) { | ||
this.uid = uid; | ||
this.serviceId = serviceId; | ||
this.url = url; | ||
this.title = title; | ||
this.streamType = streamType; | ||
this.duration = duration; | ||
this.uploader = uploader; | ||
this.thumbnailUrl = thumbnailUrl; | ||
this.streamId = streamId; | ||
this.joinIndex = joinIndex; | ||
} | ||
|
||
public StreamInfoItem toStreamInfoItem() throws IllegalArgumentException { | ||
StreamInfoItem item = new StreamInfoItem(serviceId, url, title, streamType); | ||
item.setThumbnailUrl(thumbnailUrl); | ||
item.setUploaderName(uploader); | ||
item.setDuration(duration); | ||
return item; | ||
} | ||
|
||
@Override | ||
public LocalItemType getLocalItemType() { | ||
return LocalItemType.PLAYLIST_STREAM_ITEM; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.